Nonlinear Iteration is not converging?
9 views (last 30 days)
Show older comments
Hello, I give an error about:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Solver encountered an error while simulating model 'PID' at time 729.49130150480926 and cannot continue. Please check the model for errors.
Nonlinear iteration is not converging with step size reduced to hmin (2.59167E-12) at time 729.491. Try reducing the minimum step size and/or relax the relative error tolerance.
When I check the scopes of my system parameters, everything is good until the time which the simulation is stopped. ı checked all my equations. But I cannot find the solution. I guess this problem is about infinite or finite parameters. Why this problem does occur? and How I solve this problem
Thanks for your answers.
4 Comments
Dyuman Joshi
on 27 Jan 2024
@Yusuf Taha Okutan, As Torsten said, Please send it to TMW Technical support via this link - Contact Support
Answers (1)
Sam Chak
on 27 Jan 2024
Based on your Simulink model titled "PID.slx," it seems that you are attempting to simulate the motion of an unmanned aerial vehicle (UAV). In the field of aerospace engineering, it is well-known that the equations of motion for UAVs are highly nonlinear, coupled, and unstable. Additionally, it appears that you are utilizing Euler angles as the attitude reference frame, which can lead to kinematic singularities at certain angles, such as 90 degrees (or 270 degrees).
Without an active flight control system in place, it is not surprising that certain state values may continue to grow significantly, resulting in numerical issues for the Simulink solver.

2 Comments
Sam Chak
on 29 Jan 2024
Since this is not a bug-related issue, I suggest to derive the control system equations and write code that models the system according to the rules in MATLAB programming. This way, it becomes easier to check for mistakes in typos, signs, or incorrect usage of mathematical functions. Once the code is successfully implemented, constructing a Simulink model based on the MATLAB code becomes a straightforward task.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!