ODE solvers and multiple tspans

6 views (last 30 days)
David
David on 16 Feb 2012
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?

Accepted Answer

David
David on 16 Feb 2012
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.

More Answers (1)

Jan
Jan on 16 Feb 2012
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?

Community Treasure Hunt

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

Start Hunting!