Problem about the ode45 time steps?
2 views (last 30 days)
Show older comments
I was confused about the ode45 time steps, and l saw the Runge-Kutta in wikipedia
I saw many community from the MathWorks, and I know that ode45 will control the time step adaptively.
I also learned it from my professor, but I has a problem.
What is constant time steps? Is this the same as output time?
From my view, the output time matrix is the same as the input times step, and it's the same time step.
Is the above discussion right or not?
Which condition will cause the different output time step happen? (If my comprehension is right.)
(Other Author problem: https://www.mathworks.com/matlabcentral/answers/409203-how-to-fix-the-time-step-in-ode45)
0 Comments
Accepted Answer
Torsten
on 26 Jun 2023
You specify the times when you want ODE45 to output the solution in the array "tspan".
This array is not used by ODE45 to deduce the time steps to be made to get the solution of the problem. The "internal" time stepping is done with respect to the relative and absolute error tolerances (RelTol and AbsTol) you prescribe in the options setting. The solution at the specified times from "tspan" is then deduced from the solution at the "internal" times via interpolation.
More Answers (0)
See Also
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!