Getting error : "Transient initialization at time 2.23965, solving for consistent states and modes, failed to converge."

65 views (last 30 days)
I am tring to simulate motor control model in matlab using simscape. Model start runnning without any error but after some time it throws warings and eventualy error.
Following is the warning :
"Solver was unable to reduce the step size without violating minimum step size of 7.76595E-15 for 5 consecutive times at time 2.18592. Solver will continue the simulation with the step size restricted to 7.76595E-15 and using an effective relative error tolerance of 0.00117102, which is greater than the specified relative error tolerance of 0.001. This usually may be caused by violating algebraic constraints in the differential-algebraic system or by the high stiffness of the system. Try tightening the error tolerances, and/or the tolerances for computing consistent conditions. If the problem persists, please check the system or increase the solver Number of consecutive min steps violation parameter."
I have increased the Number of consecutive min step to 5, still warnings persist.
Here is the Error :
  • Transient initialization at time 2.239652580000184, solving for consistent states and modes, failed to converge.
  • Nonlinear solver: failed to converge, residual norm too large.
After this my simulation stops.
Could you please discribe where things can go wrong ?
  2 Comments
Aditya
Aditya on 3 Jul 2023
Hi Parth,
This error is usually caused due to 'Algebraic Loops' in your simulation, you can check for them using the below command
Simulink.BlockDiagram.getAlgebraicLoops('name of your file')
Once you get rid of them, your simulation should run fine and much quicker. Hope this helps!
Parth Patel
Parth Patel on 3 Jul 2023
Edited: Parth Patel on 3 Jul 2023
Hello Aditya,
Thanks for repying. I have ran the given command. I got below message:
No algebraic loops were found.
ans =
0×0 AlgebraicLoop array with properties:
Model
Id
VariableBlockHandles
BlockHandles
IsArtificial
There is no algebric loop in the system. Please show the next possible isuue.

Sign in to comment.

Answers (1)

nick
nick on 29 Jan 2024
Hi Parth,
I understand from your query that you are seeking to resolve the error "failed to converge, residual norm too large."
Please provide the complete model and any associated files pertaining to this error. This error commonly occurs when a model is excessively idealized, resulting in abrupt transitions that prevent the solver from converging. In such cases, the solver may attempt transient initialization.
To help rectify the error, I recommend the following modifications:
1. Reduce the maximum time step to see if a smaller step facilitates convergence of the simulation.
2. Increase the solver's convergence tolerance in the configuration settings.
3. Modify component parameters, such as 'Open Resistance' or 'Closed Conductance', to make the model more representative of actual conditions and less idealized.
4. Examine the model for any errors, inconsistencies, or incorrect assumptions. Simplify the model by removing unnecessary components or subsystems.
You may refer the following documentation to learn more about troubleshooting simulation errors :
Hope this helps.
  1 Comment
REDDYPALLY RAKESH
REDDYPALLY RAKESH on 6 Aug 2025
I am facing the same issue
Error:An error occurred during simulation and the simulation was terminated
Caused by:
['Copy/Control System/Solver Configuration']: Transient initialization at time 753.3825530318544, solving for consistent states and modes, failed to converge.
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
The model may not give enough information to make it possible to solve for values of some of its variables. Specific advice is given below.
all components and nodal across variables involved
Cannot solve for one or more variables:
'Vehicle_model4.Differential.S1.w' (Rotational velocity)
'Vehicle_model4.Differential.S2.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_left.P.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_left.S.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_left.damper.R.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_left.damper.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_right.P.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_right.S.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_right.damper.R.w' (Rotational velocity)
'Vehicle_model4.Differential.sun_planet_right.damper.w' (Rotational velocity)
'Vehicle_model4.Tire_Magic_Formula.A.w' (Rotational velocity)
'Vehicle_model4.Tire_Magic_Formula.tire_road_interaction.T.v' (Velocity)
'Vehicle_model4.Tire_Magic_Formula.wheel_axle.A.w' (Rotational velocity)
'Vehicle_model4.Tire_Magic_Formula.wheel_axle.P.v' (Velocity)
'Vehicle_model4.Tire_Magic_Formula1.A.w' (Rotational velocity)
'Vehicle_model4.Tire_Magic_Formula1.tire_road_interaction.T.v' (Velocity)
'Vehicle_model4.Tire_Magic_Formula1.wheel_axle.A.w' (Rotational velocity)
'Vehicle_model4.Tire_Magic_Formula1.wheel_axle.P.v' (Velocity)
Equations (including nonlinear equations) of one or more components may be dependent or inconsistent. This can cause problems in transient initialization. Here is the set of components involved:
all components involved
'Copy/Vehicle model4/Differential'
Equation locations are:
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\simscape\library\m\+foundation\+mechanical\+rotational\damper.ssc' (line 21)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+gears\+planetary_subcomponents\sun_planet_bevel.sscp' (no line number info)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\simscape\library\m\+foundation\+mechanical\+rotational\damper.ssc' (line 21)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+gears\+planetary_subcomponents\sun_planet_bevel.sscp' (no line number info)
'Copy/Vehicle model4/Tire (Magic Formula)'
Equation locations are:
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_resistance.ssc' (line 93)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 112)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 158)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 159)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_radius.ssc' (line 102)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\tire_magic.ssc' (line 192)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\tire_magic.ssc' (line 321)
'Copy/Vehicle model4/Tire (Magic Formula)1'
Equation locations are:
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_resistance.ssc' (line 93)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 112)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 158)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 159)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_radius.ssc' (line 102)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\tire_magic.ssc' (line 192)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\tire_magic.ssc' (line 321)
'Copy/Vehicle model4/Tire (Magic Formula)2'
Equation locations are:
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_resistance.ssc' (line 93)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 158)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\magic_formula.ssc' (line 159)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\+tire_subcomponents\rolling_radius.ssc' (line 102)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\tire_magic.ssc' (line 321)
'Copy/Vehicle model4/Vehicle Body'
Equation locations are:
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\vehicle_body.ssc' (line 232)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\vehicle_body.ssc' (line 233)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\vehicle_body.ssc' (line 344)
'C:\Program Files\MATLAB\R2024a\toolbox\physmod\sdl\sdl\+sdl\+tires\vehicle_body.ssc' (line 345)
Can you please look this model, the model fails to run at 753 sec, i cant figure it out why

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Categories

Find more on Variable Initialization in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!