MATLAB: What interpolation algorithm does the ODE45 function in MATLAB use to evaluate the outputs at the time steps specified in the “tspan” input

dormanddormand-princeinterpolateMATLABodeprincetimespantimesteps

The syntax of the ODE45 function is as follows:
[T,Y] = solver(odefun,tspan,y0)
If I specify the "tspan" input with more than two elements, the solver uses interpolation to evaluate and return the output at each intermediate time steps. I would like to know what interpolation algorithm does the ODE45 function use in this process.

Best Answer

The ODE45 function uses the Dormand-Prince DOPRI5(4) method described in the following reference:
Hairer, Norsett, Wanner, "Solving Ordinary Differential Equations", first edition, vol. I, p. 171 - 179
The interpolation uses slightly differenct coefficients than the implementation in the reference. For details of the implementation refer to the NTRP45 function which can be viewed using the following command:
type('private/ntrp45')