4

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:

enter image description here

and the ode45 solution:

enter image description here

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

am304
  • 1,841
  • 13
  • 22
Deccoyi
  • 41
  • 1

1 Answers1

1

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

Matlab Answers page

Decision tree to pick an ODE solver

about ordinary differential equations

The basic idea is:

  1. start with a variable time-step solver (ode45, for example)
  2. if solver performance is not as desired (too long to compute a timestep), start with the simplest method (ode1 Euler) and iteratively try higher order solutions until you arrive at an acceptable accuracy.

If you do not have design constraints like using a fixed-time-step ode solver, going with the highest one that you can afford (ode45?) would be the best idea.

Gürkan Çetin
  • 906
  • 5
  • 21