Source

Adapted from my own handwritten and hand-typed notes from Year 1 to Year 3 of my EEE degree

The classical fourth order Runge-Kutta method (RK4) is the most accurate method in the course and is widely used in practice. Each step samples the slope four times and takes a weighted average.

Formula

For , :

What each term means:

  • : slope at the start of the step
  • , : two estimates of the slope at the midpoint (weighted double)
  • : slope at the end of the step

Error

Local truncation error and global error , so it is fourth order. Halving cuts the error by about 16 times.

Worked example

, , , first step:

0.20.40.60.81.0
RK4 0.0214000.0918180.2221060.4255210.718251
exact0.0214030.0918250.2221190.4255410.718282

Comparison of methods

MethodSlope evaluations per stepOrder (global error)
Euler1
Improved Euler2
RK44

All three methods extend directly to Numerical Methods for ODE Systems.