- Refrain from connecting op-amps to the MOSFET gate control port. This may lead to numerical transient inconsistencies that can't be resolved by the solver.
- Watch out for electrical interferences between parts of your circuit. Undesired interferences may lead to unmitigated dynamic effects such as high-frequency oscillations, which can cause issues for the solver.
How to troubleshoot Simscape error "Nonlinear solver: failed to converge, residual norm too large."?
35 views (last 30 days)
Show older comments
MathWorks Support Team
on 17 Jun 2025
Answered: MathWorks Support Team
on 17 Jun 2025
What does the "Nonlinear solver: failed to converge, residual norm too large." error mean in Simscape, and how can I troubleshoot it?
Accepted Answer
MathWorks Support Team
on 17 Jun 2025
The error is saying that Simscape is incapable of solving your system. This can occur for a variety of reasons; however, most often it is caused by a sudden transition within the model. To troubleshoot the issue, you can try the following:
1) Check to see if there are any sudden changes, such as a change in pressure or unexpected events, such as a very low pressure, in your model at the time of the error. This can be caused by the model being too ideal, meaning sudden transitions. In this case, the Simscape solver has to go through the "Transient Initialization" phase, and the initial guess is too far from the results, and it fails to converge. One way to troubleshoot this is to add more realistic conditions to your model. This can be many different things depending on the physical domain. The
provides more information on this.
2) Switch your solver and increase your tolerances, for example, if you are using "Variable Step Auto", try "ode23t", and if your tolerances are 1e-5, try increasing to 1e-3. The
provides more information on this topic.
3) Use the Solver Profiler to determine what the solver is doing just before you receive the error. In the step size tab, you should see a graph showing the step spike down as it approaches the time of the error occurring. If you zoom in on that spike, there should be more information, such as an indication that there is a zero crossing. The
provides more information.
4) If you are using Simscape Electrical with MOSFETs:
Please note that this error is very generic and that these steps are only a starting point to help find the cause of the error.
0 Comments
More Answers (0)
See Also
Categories
Find more on Electrical Systems 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!