Connecting Artificial Neural Network (ANN) Model to Extended Kalman Filter

10 次查看(过去 30 天)
Hi,
I have an ANN model, which is a black-box non-linear model developed. How do I implement or connect this model to an extended or Unscented Kalman filter (EKF or UKF) in Simulink? Especially how to generate or write the state transition and measurement functions for such a system and then flow/stream a live data for the filter to compare the preictions from the ANN model with that of the live data and make the best estimate?
Thank you!

回答(1 个)

Ayush Aniket
Ayush Aniket 2025-6-3
One of the ways you can integrate an ANN model with an Extended or Unscented Kalman Filter (UKF) in Simulink is by careful formulation of the state transition and measurement functions. Refer the steps below:
1. Since your ANN model is a black-box nonlinear system, you need to approximate its behavior using state-space representations:
  • State Transition Function: Defines how the system evolves over time. If your ANN predicts the next state based on the current state, you can use: where ( x_k ) is the state, ( u_k ) is the control input, and ( w_k ) is process noise.
  • Measurement Function: Defines how the system measurements relate to the state: where ( z_k ) is the measurement and ( v_k ) is measurement noise.
For EKF, you need Jacobians of these functions, while UKF uses sigma points to approximate nonlinear transformations.
2.Simulink implementation -
  • Use MATLAB Function Blocks to define the state transition and measurement functions.
  • Implement the EKF or UKF using Simulink’s trackingEKF or trackingUKF blocks.
  • Connect the ANN model output to the filter’s prediction step.
3. Streaming Live Data
  • Use Simulink’s From Workspace or UDP blocks to stream real-time data.
  • Compare ANN predictions with live measurements and update the filter’s estimate.
Refer to the following github repository and coumentation link that implements SOC estimation using EKF and UKF in Simulink, and provides detailed documentation on EKF and their implementation:

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by