What are the details of the interpolation scheme done in ode45?
3 views (last 30 days)
Show older comments
I understand that ode45 uses Dormand-Prince method to generate the solution at the adaptive time steps. So in the case when tspan input is with more than two elements, the documentation points out that it doesn't affect internal time step. So even though it returns the answer at the specified tspan values, it's not guaranteed that the solver stepped exactly to those values but rather somewhere close, since it's adaptive in nature. My question is what does it use to produce the answer at the desired node since the solver didn't step there? What are the details of this interpolation scheme?
This is the documentation found in the help for ode45 (below):
Specifying tspan with more than two elements does not affect the internal time steps that the solver uses to traverse the interval from tspan(1) to tspan(end). (All solvers in the ODE suite obtain output values by means of continuous extensions of the basic formulas) [WHAT DOES THIS SENTENCE MEAN?!]. (Although a solver does not necessarily step precisely to a time point specified in tspan, the solutions produced at the specified time points are of the same order of accuracy as the solutions computed at the internal time points) [WHAT METHOD IS USED FOR THIS? TO GET THE SAME ORDER OF ACCURACY].
Thanks in advance!
Thanks for the help!
0 Comments
Accepted Answer
Kelly Kearney
on 10 Dec 2013
The interpolation is done by the ntrp45 function (<matlabroot>/toolbox/matlab/funfun/private/ntrp45.m); you can open that and examine.
0 Comments
More Answers (2)
Dragan Plakalovic
on 10 Dec 2013
2 Comments
Kelly Kearney
on 10 Dec 2013
Sounds plausible, though it would depend on exactly how you implemented the RK4 function. The Mathworks used to offer fixed-step solvers (ode1, ode2, ode3, ode4, and ode5) on their website through one of the tech notes, but now that they've redone the website I can't find them... anyone know where those are now?
Dragan Plakalovic
on 10 Dec 2013
1 Comment
金灵 周
on 10 Oct 2020
Hello, I have the same confusion.whether ntrp45 interpolate every point separately or it's some sort of vectorization involved to make it even faster?May I ask if you are making progress in this question
Thank you for your reply.
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!