Runge-Kutta Methods

Runge-Kutta (RK) methods are a family of numerical techniques for solving first-order initial-value ODEs of the form dy/dx = f(x, y), y(x₀) = y₀. Unlike the Euler method, which uses only the slope at the beginning of the interval, RK methods combine multiple slope evaluations within each step to achieve higher accuracy. The classical fourth-order Runge-Kutta method (RK4) is the most widely used. It evaluates the slope at four points within the interval and takes a weighted average: k₁ = f(x_n, y_n) (slope at the beginning); k₂ = f(x_n + h/2, y_n + h·k₁/2) (slope at the midpoint, using Euler estimate); k₃ = f(x_n + h/2, y_n + h·k₂/2) (slope at the midpoint, using k₂); k₄ = f(x_n + h, y_n + h·k₃) (slope at the end, using k₃). The update is: y_{n+1} = y_n + (h/6)(k₁ + 2k₂ + 2k₃ + k₄). The weights (1, 2, 2, 1)/6 are chosen so that the Taylor series expansion of the RK4 formula matches the true solution up to the h⁴ term. This makes RK4 fourth-order accurate: the local truncation error is O(h⁵), and the global truncation error is O(h⁴). Halving the step size reduces the global error by approximately a factor of 16, making RK4 much more accurate than Euler's method (O(h)) for the same step size. To apply RK4: (1) Specify dy/dx = f(x, y) and y(x₀) = y₀. (2) Choose step size h. (3) For each step, compute k₁, k₂, k₃, k₄ as defined above. (4) Update y_{n+1} = y_n + (h/6)(k₁ + 2k₂ + 2k₃ + k₄) and x_{n+1} = x_n + h. (5) Repeat until the desired x is reached. RK methods extend to systems of ODEs by applying the same formulas to each equation simultaneously. For example, for dy₁/dx = f₁(x, y₁, y₂) and dy₂/dx = f₂(x, y₁, y₂), compute k₁, k₂, k₃, k₄ for both y₁ and y₂ at each step. Adaptive Runge-Kutta methods (e.g., RK45, Dormand-Prince) estimate the local error by comparing results from two methods of different orders (e.g., 4th and 5th order) and automatically adjust h to maintain the error below a specified tolerance. This is more efficient than using a fixed small h everywhere. Compared to Euler: RK4 requires 4 function evaluations per step vs. 1 for Euler, but achieves much higher accuracy, often allowing larger step sizes and fewer total steps for the same accuracy.

Governing FormulaRK4 slopes: k₁ = f(x_n, y_n) k₂ = f(x_n + h/2, y_n + h·k₁/2) k₃ = f(x_n + h/2, y_n + h·k₂/2) k₄ = f(x_n + h, y_n + h·k₃) RK4 update: y_{n+1} = y_n + (h/6)(k₁ + 2k₂ + 2k₃ + k₄) Step update: x_{n+1} = x_n + h Local truncation error: O(h⁵) Global truncation error: O(h⁴) RK2 (improved Euler / Heun): y_{n+1} = y_n + (h/2)(k₁ + k₂), where k₁ = f(x_n, y_n), k₂ = f(x_n + h, y_n + h·k₁) Where: h = step size, f(x, y) = dy/dx, (x_n, y_n) = current point, (x_{n+1}, y_{n+1}) = next point

Knowledge Check

10 Questions

1.What type of differential equation does the Runge-Kutta method solve?

2.In RK4, how many slope evaluations (k values) are computed per step?

3.What is the global truncation error order of RK4?

4.For dy/dx = x + y, y(0) = 1, h = 0.1, what is k₁ at the first step?

5.Continuing from the previous question, what is k₂?

6.Why does RK4 achieve higher accuracy than Euler's method?

7.What is the main advantage of adaptive Runge-Kutta methods (e.g., RK45)?

8.For a system of two ODEs, how is RK4 applied?

9.Compared to Euler's method, RK4 typically requires what for the same accuracy?

10.What are the weights applied to k₁, k₂, k₃, k₄ in the RK4 update formula?