# How to obtain error bound on Runge-Kutta 4th order method?

I am using Runge-Kutta 4th order method for numerical simulation of system of ODEs $x'=f(t,x)$ where $x$ has around 20 dimensions.

I wish to give a bound on the global error.

I know that the global accumulated error is $O(h^4)$, but I need an actual bound, ie what is the coefficient of $h^4$ and a bound on the terms that comes after $h^4$.

I can obtain a bound on both $|x|$ and $|\frac{dx}{dt}|$ (by appealing to physics, since my system is modelling some real-life things), but it's hard to compute bounds for higher order derivatives.

I'm sure there are many methods for error estimation, but I just need one. It doesn't have to be asymptotically tight, just an upper bound is enough.

• A very common method for estimating the truncation error is using step-doubling: take a single step of length $2h$ and compare this with two steps of length $h$. Use the difference (divided by $2^n-1$ where $n=4$ for RK4) as an estimate for the truncation error. Some other methods are mentioned in this article – Winther Mar 8 '17 at 1:57
• Then divide by $h^4$ to get the coefficient of the lowest order error term. For a middling range of $h$ (often 1e-2 to 1e-4) you should get consistently constant values. For larger $h$, the non-linearity of the problem has too much influence, for smaller $h$, the accumulation of floating point errors over the $O(1/h)$ integration steps dominates over the method error. – Dr. Lutz Lehmann Mar 31 '17 at 9:15

The true answer of above question is $E=\frac{Yn+2(h)-Yn+2(2h)}{2^(m+1)-2}$ so for 4th order of RK, m=4; the error would be $E=\frac{Yn+2(h)-Yn+2(2h)}{30}$.
• The use of $2^{m+1}$ is also wrong. The local error of a step of size $h$ is $O(h^5)$, but the error over a fixed time interval $\Delta t$ over a variable number of steps $n$, $nh=\Delta t$, which you need here, is $O(\Delta t\cdot h^4)$ – Dr. Lutz Lehmann May 13 '18 at 10:11