MATLAB: Does the ODE23tb solver fails to converge for the stiff system at a certain time step in Simulink 7.8 (R2011b)

simulink

I have a Simulink model that simulates a highly oscillatory system i.e a stiff system. When using the ODE23tb solver, Simulink converges up until a given time step and would not continue. When I look at the ouput, the very high values seem to indicate that the solver is diverging.

Best Answer

The main reason for this is numerical instability. In such a system, oscillations can be so fast that quantities used by the solver from one time step to another be poorly computed. As a result, the solver diverges.
A first workaround is to use a lower relative tolerance. To do so, please follow the steps below:
1. Open MATLAB.
2. Open the Simulink model.
3. Click on the 'Simulation' tab of the text menu and select 'Configuration Parameters'.
4. Update and decrease the 'Relative tolerance'.
5. Run the model.
6. Repeat previous steps until convergence is reached.
A second approach is to use the ODE15s solver. This solver is also suited for stiff systems but makes use of a different numerical algorithm. Therefore, the different numerical dissipation in such an algorithm might make the system stable.
To change the solver type to ODE15s, please follow the steps below:
1. Follow the above-described steps up until step 4 (non-included)
2. Update the Solver to 'ode15s.
3. Run the model.