Absolute error of ODE45 and Runge-Kutta methods compared with analytical solution

Your RK4 function is taking fixed steps that are much smaller than those that ode45 is taking. What you’re really seeing is the error due to polynomial interpolation that is used to produce the points in between the true steps that ode45 takes. This is often referred to as “dense output” (see Hairer & Ostermann … Read more