Clear Filters
Clear Filters

a problem in descretizing a system

21 views (last 30 days)
Faezeh Yousefpour
Faezeh Yousefpour on 17 Sep 2024 at 18:24
Commented: Torsten on 17 Sep 2024 at 19:03
Hello. I have this quarter car state space equation which I want to use extended kalman filter to estimate states. But when I want to descretize using euler forward method, after a few iteration it becomes NaN and I cant use EKF. Do you kbow how to solve the problem? I changed initial conditions and sample time also I used other methods of descretizing but they didnt work!

Answers (1)

akshatsood
akshatsood on 17 Sep 2024 at 18:47
Edited: akshatsood on 17 Sep 2024 at 18:49
I understand that your system becomes NaN after a few iterations. It shows numerical instability or divergence issues.
Here are several strategies you can try to resolve the problem:
  • Check System Stability: Ensure that your continuous-time system is stable which can be evaluated through using the "eig" (checking for eigenvalues) and "isstable" function. If the system is inherently unstable, discretizing it might not help unless you implement a control strategy.
  • Adjust Sample Time: While you've already tried changing the sample time, ensure it's sufficiently small to capture the dynamics of your system accurately. A very large sample time can lead to poor approximations.MATLAB "c2d" function cna be leveraged for converting continuous systems to discrete systems with a specified sample time.
  • Scaling and Normalization: Normalize your state variables and inputs using "normalize" function to ensure they are in a reasonable range. Large variations in magnitude can lead to numerical issues.
  • Improved Discretization Method: While Euler's method is the simplest, it may not be sufficient for all systems. Consider using more advanced methods like Runge-Kutta or Tustin's (bilinear transformation) methods.
  • Regularization: Add a small regularization term to your estimates to prevent them from growing too large.
  • Review the EKF Implementation: Double-check the implementation of your Extended Kalman Filter to ensure that the Jacobians are computed correctly and that the update equations are implemented.
If you try these strategies and still encounter issues, consider sharing more details about your system equations and the specific implementation of your EKF, as this might help in diagnosing the problem further.
I hope this helps.

Community Treasure Hunt

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

Start Hunting!