Getting the error message "Derivative of state X in block 'XXX' at time XX is not finite. The simulation will be stopped. There may be a singularity in the solution" when using fixed step solver

55 views (last 30 days)
I have a Simulink model with integrator blocks. The initial condition of the integrator is zero. The signal to be integrated is the result of dividing 2 scalar values. I have two questions:
1. I get 2 different results when running the simulink model using a solver with fixed vs. variable step size (set by using Simulation-> Model Configuration Parameters). If I use a 'variable step size', the model runs smoothly. If I use 'fixed step size' with a step size of 0.001 (i.e. my sampling time), I get the error message: "Derivative of state '1' in block 'XXX/Integrator' at time XXX is not finite. The simulation will be stopped. 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 referred to one of the answers to this question, but it didn't help. My states are initially close to zero, they just jump to high values towards the end. Can anyone suggest a solution or an explanation? P.S. scaling before the division doesn't help either.
2. To divide the 2 scalar values, I use the usual division sign (/). However, I tried to save the values to the workspace and divide them manually (without doing it in Simulink) to test the difference. Why does a simple division give different results depending on the solver's step size?
Thanks in advance! I hope my questions are clear though.

Answers (1)

Megha Parthasarathy
Megha Parthasarathy on 16 May 2017
Hello,
This problem is caused due to setting of the 'Absolute tolerance' in the Solver plane in the Configuration Parameters. If the setting is tightened the model will run well and this error does not occur.
The Solver Profiler Interface will help to analyze similar models facing the same issues and reveal the DAE Newton Iteration Exceptions which cause the error.
Hope this helps.
Megha
  6 Comments
Aitor Estarlich
Aitor Estarlich on 28 Mar 2020
Hello @Walter Roberson,
I am getting the same issue. I actually have the output of the integrator into its input somewhere back in the line. How could I solve this?
Thank you.

Sign in to comment.

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!