All courses › Numerical Methods › Runge–Kutta (RK4)
Runge–Kutta (RK4)
The classic Runge–Kutta method (RK4) is a fourth-order method that uses four function evaluations per step to estimate the slope more accurately than Euler. Global error is , so a small reduction in gives a large gain in accuracy.
the RK4 update
Symbols
| four slopes evaluated at different points within the step |
Example
Dividing the step size by 10 in an order-2 method (Heun) makes the error roughly times smaller; for RK4 it becomes times smaller.
RK4 is more expensive per step than Euler (four evaluations versus one), but it almost always pays off in accuracy.
Practise differential equations and stability for free →
← Euler's method · Stiffness and stability →
Part of Numerical Methods: Differential equations and stability.