MATLAB Answers

0

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

I am receiving the following error messages about singularities in my Simulink model:
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.

4 Answers

Answer by MathWorks Support Team on 14 Apr 2011
 Accepted Answer

This message may be caused by a singularity in your system. One situation where this may occur is if the values of your states differ by a large magnitude. If this is the case, the Simulink solver will have a hard time resolving your step size within the error tolerance as it attempts to "bounce" back and forth between the states.
To check if this is the case:
1. Return the states of your system as follows-
a) In the model editor go to Simulation-> Configuration Parameters
b) Select Data Import/Export, in the 'Save to Workspace' field, check 'States' to log the states as output
2. Run the simulation.
3. Plot:
plot(tout,xout)
You can see if one of the states is changing over a wide range compared to the others.
There are a couple of things you can do to try to correct this situation. If possible, you may want to rescale the model so that the states are within a couple of orders of magnitude of one another.
Also, you can set specific error tolerances for the integrator blocks in your system. For more information, please refer to 'Specifying the Absolute Tolerance for the Block's Outputs' section in the Integrator block documentation by entering
doc integrator
at the MATLAB command prompt.

  12 Comments

@Moushumi Patowary...... I am facing the same problem.....If you have solved the problem...can u please help me out. The error is: Algebraic state in algebraic loop containing 'ILST_PV1/Inverter Control/Estimation of Unit Vector/Divide2' computed at time 0.0 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Please refer to the answer by Sorelys Sandoval posted below, and see if that helps resolve the issue. If not, please consider contacting MathWorks technical support for further assistance.

Sign in to comment.


Answer by 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

  1 Comment

In the case of a stiff system, changing the solver type could help resolve the issue.

Sign in to comment.


Answer by Shubhangi Bhadoria on 9 Sep 2016

Hi !
I am stuck in algebric loop which I tried to remove by memory block, algebric constraint block and unit delay but none of them could solve the problem. But If I apply delay of 100 samples, then error is removed but output(performance) is changed completely.
So, I checked if 'one of the states is changing over a wide range compared to the others'. Yes, this is the problem in my model. But I can not resize the model and there os no integrator used. Any suggestions in this regard? How can I fix it? Thanks in advance.

  0 Comments

Sign in to comment.


Answer by Vivej Sharma on 24 Jan 2018

I am facing this issue.Kindly help.
Algebraic state in algebraic loop containing 'pvboostconvereterIM/PV Array 3/I Filter/First-Order Filter/Model/Sum1' computed at time 1.8060708922720616E-7 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

  6 Comments

@ mathwork i have a similar problem . i am using a trying to simulate a pv array from simscape and connect with a dc dc boost converter using p & o mppt algorithms. i already break the algebraic loop from pv array and avoided 0/1 for singularity but the error say' derivative of state '1' in block 'dcdcboostconverter3718/pv array/diode rsh/BAL/Transfer Fcn' at time 0.0 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 had the same issue, I am currently testing the MATLAB PV array on simescape. What solved the issue for me was to decrease the initial step size less than the maximum step size as well as the relative tolerance in the 'Configuration Parameters'.
Could you tell to what values you changed the initial step size, maximum step size, and relative tolerance to?

Sign in to comment.