Numerical Methods for ODEs

the Runge-Kutta method

/ ROONG-uh KOO-tah /

Forward Euler is short-sighted: it reads the slope only at the start of a step, so it always misjudges where the curve is bending. A smarter idea is to peek ahead — sample the slope at one or more points INSIDE the step, then take a step whose direction is a clever average of those samples. Runge-Kutta methods are exactly this family of 'sample several slopes per step, then combine them' schemes, achieving high accuracy without remembering any past steps.

The simplest improvement is the MIDPOINT method: use the start slope to peek halfway across the step, read the slope THERE, and use that better slope for the whole step. In steps: k1 = f(t_n, y_n); k2 = f(t_n + h/2, y_n + (h/2)*k1); y_{n+1} = y_n + h*k2. This is second order — error O(h^2). HEUN's method (improved Euler) instead averages the start slope and the slope at a tentative Euler-predicted endpoint: k1 = f(t_n, y_n); k2 = f(t_n + h, y_n + h*k1); y_{n+1} = y_n + (h/2)*(k1 + k2), also second order. Each evaluates f twice per step but cancels the leading error term that Euler leaves behind, the way Simpson's rule beats the rectangle rule for integration.

Runge-Kutta methods are the dominant general-purpose ODE solvers for good reason: they are SELF-STARTING (they need only the current point, unlike multistep methods that need a history), they easily reach high order, and the well-known fourth-order RK4 hits an excellent accuracy-for-effort sweet spot. The honest caveats: more accuracy means more f-evaluations per step (cost), and standard EXPLICIT Runge-Kutta methods are only conditionally stable — they are poor for stiff problems, where you need IMPLICIT Runge-Kutta or BDF methods instead. The recipe of stages and weights that defines any particular Runge-Kutta method is compactly recorded in a Butcher tableau.

On y' = y, y(0) = 1, one midpoint step with h = 0.5: k1 = 1, k2 = f(0.25, 1 + 0.25*1) = 1.25, so y_1 = 1 + 0.5*1.25 = 1.625. The true e^0.5 = 1.6487. Forward Euler gives only 1 + 0.5 = 1.5 — the midpoint method's single extra slope sample roughly halves the gap and gives second-order accuracy.

Peek inside the step, sample the slope at better points, then combine — accuracy without history.

Explicit Runge-Kutta methods are NOT a cure-all: on a stiff problem they still need tiny steps for stability, no matter how high their order. There 'high order' is wasted unless the method is implicit (or you switch to BDF).

Also called
RK methodmidpoint methodHeun's methodRK family龍格庫塔法