How do I force ode45 to take steps of exactly 0.01 on the T axis?

前端 未结 6 1864
再見小時候
再見小時候 2021-01-05 14:44

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

6条回答
  •  借酒劲吻你
    2021-01-05 15:01

    Well, you cannot ensure that it will ONLY calculate those steps, but you can ensure the maximum step size (and if you do it small enough you can are almost sure that you have all the desired times and take just those samples):

    options= odeset('MaxStep',1);
    [t,s] = ode45(@myode,tspan,[0;0],options);
    

    to know more you can go to here:

提交回复
热议问题