An error occurred while running the simulation and the simulation was terminated

614 views (last 30 days)
Trouble solving algebraic equations in differential-algebraic system. Singular iteration matrix encountered with step size 3.3730961873744423E-9 at time 0.0. Consider providing more accurate initial conditions. If the problem persists, check the model structure and values of parameters.
what should I do ?
  1 Comment
awatef chouat
awatef chouat on 25 Sep 2020
Algebraic state in algebraic loop containing 'Systeme_PV_connecte/Champ PV 2/Diode/Product2' computed at time 0.015000000000000001 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 what should i do?

Sign in to comment.

Answers (3)

Steve Miller
Steve Miller on 1 Feb 2018
There are many modeling mistakes or poor parameter settings that can lead to this error diagnostic. It would be necessary to see the model to find the exact answer.
Things you can try:
1. MOST IMPORTANT: Carefully check the rest of the diagnostics to see if any other warnings highlight other problems with the model. For example, does it indicate there are algebraic loops?
2. Make sure your solver is set to "Variable Step", "Auto", and check the tolerance settings.
3. Open the Simscape Variable Viewer and see if any initial conditions aren't being satisfied. For more information, read the documentation for the Simscape Variable Viewer
There are many other possible causes for this error, but this should give you a place to begin.
Steve Miller
Steve Miller on 8 Nov 2021
The diagnostic states there is an algebraic loop. You need to break this algebraic loop. Use the algebraic loop highlight tool to figure out which loop you need to break with a transfer function or a unit delay.

Sign in to comment.

John on 8 Nov 2021

nado adjr
nado adjr on 23 Jan 2022
An error occurred while running the simulation and the simulation was terminated
Caused by:
  • The expression: (1/(9*10^(-6)+0.1*u(4)))*(u(2)*u(4)*u(3)*0.1+0.98*u(3)*cos(u(1))) in 'HANANEE/Fcn2' has a subscript t
  • hat is out of range
can someone help me to find the error


Find more on Variable Initialization 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!