Nonlinear iteration is not converging (using ode23t) in Simscape Multibody

16 views (last 30 days)
I am currently faced with the error below when running my .slx file:
"Nonlinear iteration is not converging with step size reduced to hmin (5.63674E-15) at time 1.5866. Try reducing the minimum step size and/or relax the relative error tolerance."
My Simulink file aims to simulate a hopping robot which uses Simscape Multibody and Stateflow libraries. Blocks that are used which may be of concern are:
  • Spatial contact force blocks are used to model the contact between the feet and the ground. The stiffness value is set to 1e4 N/m while the damping is set to 1e3 N/(m/s) with the coefficient of static and dynamic friction is 1.0 and 0.9, respectively.
  • State transition tables are used to swtich between states of a Raibert Controller.
I am currently using the ode23t solver as I've read it is highly recommended for Simscape files, given that it is a stiff and efficient solver. The solver parameters are shown in the image below:
When running the file using the above solver parameters, the robot hops but after some time, the above error occurs. I've noticed that it occurs during a stance/contact phase of its hopping cycle. When reducing the relative error tolerance as suggested by the diagnostic viewer, the above error does not occur. However, the robot began to slip.
Previously posted on the Matlab forum regarding this error - it is suggested to change the solver. I've tried using DAE solver for Simscape which is robust and found that it solves my problem. However, I am uncertain to why the ode23t solver would not work for my application? Are there recommendations as to how the paremeters could be altered to avoid the error?

Answers (1)

Steve Miller
Steve Miller on 9 Jan 2023
For situations like this, it is possible that changes to the model and the solver settings could enable the simulation to run with ode23t. We cannot assess that, however, without examining the model directly.
During periods of extended contact, the contact force and the friction force are likely in the highly nonlinear range of the force characteristic. This can lead to the diagnostic you are seeing, but it could be other issues as well.
I suggest you use the Solver Profiler and daessc to identify which blocks and variables are causing small step sizes at this point of the simulation, and then change the parameters until you get nearly equivalent results but with larger step sizes.
  1 Comment
Zubair Martin
Zubair Martin on 12 Jan 2023
Edited: Zubair Martin on 12 Jan 2023
Hi, thank you for responding to my question. After using the Solver Profiler, there were many small step sizes that occurred during the stance/contact phase of the hop. It was triggered by multiple zero crossings caused by spatial contact force blocks and function blocks (uses min and max operations). I'm attempting to reduce excessive zero crossings as mentioned in:
Would reducing excessive zero crossings prevent the error from happening?

Sign in to comment.


Find more on Simscape Multibody 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!