ODE solvers and multiple tspans

I have a model which i use one of the odesolvers to simulate. I would like to do a comparison of the results so that I can determine the differences between the solvers. Since you do not have control of the time steps chosen be the mode I thought the way to do this would be to choose a tspan with more that two entries and run the calculation.
This seems to work for ode113 and ode45 but not for ode23tb. does anyone know why ode23tb seems to ignore the tspan I am providing?

 Respuesta aceptada

David
David el 16 de Feb. de 2012

0 votos

I have found the problem,
I was calling the function with
sol = ode45(@myfun,[0:1:12],[0 1 1],options);
and expecting the tspan values to appear in sol.x
however if you call the function
[x,y] = ode45(@myfun,[0:1:12],[0 1 1],options);
all ode solvers behave the same with x being equal to tspan. I think it must of been coincidence that the values were appearing in ode45 and ode113 sol.x vector.

Más respuestas (1)

Jan
Jan el 16 de Feb. de 2012

0 votos

The documentation tells, that ode23tb handles tspan exactly as the other integrators.
Are you sure to call the integrator with the correct syntax? Does "ode23tb seems to ignore" mean, that you are not sure?

Preguntada:

el 16 de Feb. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by