ode23s solver vs ode15s solver when simulating nonliner system with significant nonlinearity and stiffness

For simulating the closed loop system of the electro hydraulic system incorporating advanced nonlinear controller, I used ode object provided by MATLAB. Since the overall closed loop system has significant nonlinearity and stiffness, I have used the ode15s solver and the ode23s solver due to their ability in solving stiff odes. Under the same setting, the simulation result of ode23s is normal, but the simulation process of the ode15s is stucked. What causes the ode15s solver to get stuck and how to resolve this issue, I want to use the ode15s solver since it is more accurate than ode23s solver.
Figure 1. odeplot of ode15s solver Figure 2. odeplot of ode23s solver

4 Comments

Is there no error message from ODE15S ?
Just to see whether the reason is due to the difficulty of the system you try to integrate: Increase "RelTol" and "AbsTol" for the ODE solver to 1e-4, e.g. . Does ODE15S succeed now ?
@Torsten. Thanks for your reply. After setting the "RelTol" and "AbsTol" to 1e-4, the simulation process of the ode15s solver is still stucked. However, when I increase the values of the "RelTol" and "AbsTol" to 1e-3, the simulation process of the ode15s is successful. I think this issue is caused by the different demands for "RelTol" and "AbsTol" in different integration states.
Figure 3. odeplot of ode15s solver with 1e-3 AbsTol and RelTol
According to the documentation, ode23s is a low-order method. These methods are especially suited if there are discontinuities in the time derivatives. In your case, this could be true since you have adjustments due to the controller. High-order methods like ode15s are not that stable for such problems.
@Torsten. The controller used for closed loop simulation contains some discontinuous terms, such as , where . I have replaced this term with , and the simulation process based on ode15s solver is successful.

Sign in to comment.

 Accepted Answer

I have find that the issue of the ode15s solver is caused by the term which has discontinuous time derivatives. After replacing it with smooth alternative, the integration process of the ode15s solver is successful.

More Answers (0)

Products

Release

R2025a

Asked:

on 23 Mar 2026 at 14:23

Answered:

on 24 Mar 2026 at 2:20

Community Treasure Hunt

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

Start Hunting!