How does the time step affect the results of ODE solvers?
Show older comments
Hello all,
I got question about ODE solvers. I have a rough understanding on how the calculations behind the solver are done and have read the documentation and other posts in other forums about them. I also have done a few tests, changing my time step and the solvers used (although I know my problem is a stiff one). Anyway, I have just started investigating these solutions and I was wondering: how does the time-step that I use affect the results. I am asking this because, in my understanding, the time step within the solver itself does not change. While, the initial conditions can affect a lot behavior of the solution.
I inherited a code from a peer and I am trying to optimize it. The ODE solver part of the code has the following structure, just to be clear on what I mean by "time step".
Tot_time = 2000; % s
interval = 0.05; % dt Integration time step
tot_it = Tot_time/interval;
while m <= tot_it
time0 = interval*(m-1);
timef = interval*m;
[tt, YY] = ode15s(@my_function, [time0 timef] ,dT, options);
dT = YY(end,:);
end
PS: this is just illustrative and it's just a piece of it to explain what I mean by time step, or dt.
I see different behaviors when I change he time step, but if the "internal" solver time-step does not change, how does the dt affect the solution? By affecting too much "initial" conditions? Just trying to understand this better.
Thank you!
:)
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!