Why am I receiving error messages about singularities in my Simulink model?

218 views (last 30 days)
I am receiving the following error messages about singularities in my Simulink model:
ERROR: Derivative of block at time is Inf of NaN. Stopping Simulation. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances.)
I have tried reducing the step size and adjusting tolerances, but I still receive this error message. I have also tried changing solvers, some solvers will just get to one point of the simulation, and hang.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Jul 2024
Edited: MathWorks Support Team on 25 Jul 2024
The most common reasons for this error are:
  • The equations are forming a positive feedback loop that diverges over time. This could be due to a modeling error, or the system modeled is actually unstable.
  • If using a fixed-step solver, the step size might be too large to properly capture the system dynamic.
  • There is a division by zero causing a Inf/NaN to enter an Integrator block.
See this blog post for more details and tips to debug this error:
  4 Comments
Walter Roberson
Walter Roberson on 1 Dec 2015
nor intanliana mohd sadik, you already posted that.
"I need to solve this as soon as possible" means that it is so important that all 6 billion or so people in the world who are not actively saving someone's life at the moment, must stop what they are doing and help you solve it, no matter what the inconvenience to them, and doing nothing else that does not involve keeping someone alive, because that is what would get you the solution "as soon as possible".
If you need that kind of assistance from everyone in the world, because a solution must be arrived at "as soon as possible" then you are going to need massive coordination from international emergency services people. For example they are going to need to go around door-to-door and wake people up and get them to work on the problem. Therefore if you need an answer "as soon as possible" you should not be starting with us, you should be starting with your police or your diplomats or who-ever else can undertake this massive coordination of people world-wide to solve your problem as soon as possible.

Sign in to comment.

More Answers (1)

Sorelys Sandoval
Sorelys Sandoval on 21 Aug 2016
Hi, I had the same problem and the next thing worked for me:
Go to model configuration parameters/Solver/Solver Options: Type: Variable-step Solver: ode15s (stiff/NDF)
and that's all. Hope it works for you :D

Products

Community Treasure Hunt

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

Start Hunting!