# Is it normal to get different solutions with different ODE methods in MATLAB simulink?

I made a block diagram using simulink. When I solve it with ode45 and ode23 it gives me different graphs. Is it normal? Should I use the proper one?

m1=1.3608;
m2=0.096;
r=0.0592;
I2=0.0002175;
k1=186.3;
g=9.81;


Here is what the model looks like:

and the ode45 solution:

I can't post the ode23 solution but it is very different.

• Why can't you post the ode23 solution? How is it different? What solver parameters are you using in each case? Apr 15 '16 at 11:00
• The answer is no. If you are getting different solutions, then you can't trust either one. You most likely need to set the time-step parameter to be smaller. Apr 15 '16 at 11:33
• As the solution is calculated numerically, small differences can exist between solutions when using different solvers or when using the same solver but with different solver settings. But the solutions should not differ fundamentally. In the latter case, you might have used an inappropriate solver or solver setting. Apr 15 '16 at 11:41
• What you have here looks to be stiff. It looks to me that the solver alternates between 2 possible solutions. Apr 16 '16 at 3:39
• Check for the parameters of the ode45 and ode23 functions. They might be using different initial conditions. Jul 17 '16 at 1:59

ode solvers are all different. I've recently compared several fixed-time-step and variable-time-step ode solvers, with the same initial conditions, with the same model. Summary: They all give different solutions, sometimes fundamentally different.

Matlab/Simulink documentation gives a rough outline of picking the most useful (not the BEST) solver for the application under consideration.

Choose an ODE solver