Matlab: how do I force ode45 to take steps of exactly 0.01 on the T axis?
Posted
by Gravitas
on Stack Overflow
See other posts from Stack Overflow
or by Gravitas
Published on 2010-03-30T22:45:20Z
Indexed on
2010/03/30
23:13 UTC
Read the original article
Hit count: 392
matlab
I'm using Matlab to solve a differential equation. I want to force ode45 to take constant steps, so it always increments 0.01 on the T axis while solving the equation. How do I do this?
ode45 is consistently taking optimized, random steps, and I can't seem to work out how to make it take consistent, small steps of 0.01. Here is the code:
options= odeset('Reltol',0.001,'Stats','on');
%figure(1);
%clf;
init=[xo yo zo]';
tspan=[to tf];
%tspan = t0:0.01:tf;
[T,Y]=ode45(name,tspan,init,options);
© Stack Overflow or respective owner