Embedded Runge-Kutta method
Runge-Kutta methods do not have a single error constant.
Instead we use two (typically explicit) Runge-Kutta methods:
-
one of $s$ stages and order $p$; and
-
one of $s+l$ stages and order $p+1$,
with the first $s$ stages identical to reduce computational cost. Then we have an estimate of the lower order method $$ \begin{align*} \v y(t_{n+1}) - \v y_{n+1}^{[1]}\approx \v y_{n+1}^{[2]} - \v y_{n+1}^{[1]}. \end{align*} $$
For example $$ \begin{align*} k_1 ={}& f(t_n, y_n), \\ k_2 ={}& f(t_n + \frac{1}{2}h, y_n + \frac{1}{2}hk_1), \\ k_3 ={}& f(t_n + h, y_n - hk_1 + 2hk_2), \\ y_{n+1}^{[1]} ={}& y_n + hk_2, \\ y_{n+1}^{[2]} ={}& y_n + \frac{1}{6}h(k_1 + 4k_2 + k_3). \end{align*} $$ $y_{n+1}^{[1]}$ has order $2$ accuracy, and $y_{n+1}^{[2]}$ has order $3$ accuracy.