ODE45, ODE113 How to get the step size in advance?
Ältere Kommentare anzeigen
Hi guys,
Is there any way to get the step size in advance from ODE45, ODE113?
Antworten (3)
Jan
am 18 Aug. 2011
0 Stimmen
No. These solver use adpative methods to determine the stepsize dynamically. Therefore you cannot get it without running the intergration.
Why do you need this?
Friedrich
am 18 Aug. 2011
0 Stimmen
Hi,
ODE45 and ODE113 have variable step size and this size is choosen during solving. So there is no stepsize you can get.
Floris
am 6 Sep. 2011
0 Stimmen
You can, if you so wish, set a maximum step size using odeset.
But this not really what you want, is it?
4 Kommentare
Grzegorz Knor
am 6 Sep. 2011
By the way, I wonder if you can determine the minimum step?
Nader
am 6 Okt. 2017
This is my query as well. Really vital to my programme. The equations are really nonlinear and it takes ages to complete one simulation. If I could control the minimum time step size, this would solve my problem. I have checked this in another commercial software, and I am 100% sure this solves the simulation time problem. Is there a way to control minimum step size in Matlab ODE functions?
Torsten
am 6 Okt. 2017
Try a stiff solver, e.g. ODE15S.
Best wishes
Torsten.
Jan
am 9 Okt. 2017
@Nader: The step size is not reduced arbitrarily in the solver, but such, that the error bounds are not exceeded. If you set a minimal step size and the integrator cannot satisfy the local discretization error, it stops with an error message - and it should do so. Fording the integrator to use too large steps leads to inaccurate results. Therefore I disagree, that this "solves" the problem. In opposite: If this works with another tool, it hides the fact, that the problem is not solved, but that you obtain a rough and perhaps completely wrong result.
Maybe your ODE is stiff. Then follow Torsten's suggestion.
ODE integrators and local optimization tools are fragile. You can get a "final value" even if you drive the tools apart from their specifications. Calling this a "result" without an analysis of the sensitivity (measure how the trajectory reacts to small variations of the inputs or parameters) is not scientifically correct. You can find many publications with such mistakes.
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!