MTH 492 · Numerical Methods
Our notes
1 min readThe idea
Runge-Kutta (RK) methods take a weighted average of several slopes inside one step, to match the Taylor series of the true solution to higher order, without needing derivatives of f.
The classical RK4
- k₁ = f(xₙ, yₙ)
- k₂ = f(xₙ + h/2, yₙ + (h/2)k₁)
- k₃ = f(xₙ + h/2, yₙ + (h/2)k₂)
- k₄ = f(xₙ + h, yₙ + h k₃)
- yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
Local error O(h⁵), global error O(h⁴). It is the workhorse for smooth, non-stiff problems.
Worked example
y′ = x + y, y(0) = 1, h = 0.1 (exact y(0.1) = 1.1103418).
- k₁ = 0 + 1 = 1
- k₂ = f(0.05, 1 + 0.05 × 1) = 0.05 + 1.05 = 1.1
- k₃ = f(0.05, 1 + 0.05 × 1.1) = 0.05 + 1.055 = 1.105
- k₄ = f(0.1, 1 + 0.1 × 1.105) = 0.1 + 1.1105 = 1.2105
- y₁ = 1 + (0.1/6)(1 + 2.2 + 2.21 + 1.2105) = 1 + (0.1/6)(6.6205) = 1.1103417
Error: about 1.7 × 10⁻⁷, against 0.0103 for Euler.
Why it works (sketch)
Expanding k₂, k₃, k₄ in Taylor series about (xₙ, yₙ) and choosing the weights 1, 2, 2, 1 (over 6) makes the result agree with y(xₙ + h) up to the h⁴ term. Many other RK formulas exist (RK2 midpoint, Ralston, RK-Fehlberg); they differ in the weights.
Choosing the step: error estimation
- Step doubling: do one step of 2h and two of h; the difference estimates the error (for RK4, error ≈ difference/15).
- Embedded pairs (RK-Fehlberg 4(5), Dormand-Prince): two formulas of orders 4 and 5 sharing the same k values. Their difference estimates the error, and the step is enlarged or cut automatically. This is how library solvers (such as MATLAB's ode45 or SciPy's solve_ivp) work.
Multistep methods (for comparison)
Adams-Bashforth and Adams-Moulton use several past points instead of extra slopes: cheaper per step, but they need a starter (often RK4) and are harder to change step with.
Exams usually ask
- Carry out one or two RK4 steps with full working.
- Derive a second-order RK method.
- Explain step-size control.
Common mistake
Using h instead of h/2 inside k₂ and k₃. They are evaluated at the midpoint.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Runge–Kutta methods
(opens en.wikipedia.org in a new tab)
Wikipedia, Runge–Kutta methods, CC BY-SA 4.0 · licence
-
NOUN MTH 307: Numerical Analysis II
NOUN course book (PDF, about 0.6 MB). Initial and boundary value problems, finite differences, Laplace's equation on a rectangle.
(opens nou.edu.ng in a new tab)
Watch
-
Best pick Runge Kutta Methods | Lecture 50 | Numerical Methods for Engineers
12 min · ≈ 54 MB · about ₦30
(opens youtube.com in a new tab)
-
Runge-Kutta Method Introduction
6 min · ≈ 27 MB · about ₦15
(opens youtube.com in a new tab)
-
7.1.2-ODEs: Introduction to Runge-Kutta Methods
6 min · ≈ 27 MB · about ₦15
(opens youtube.com in a new tab)
-
Numerical Solution of ODE by Runge - Kutta method of fourth order.
13 min · ≈ 59 MB · about ₦33
(opens youtube.com in a new tab)
-
Differential Equations with the RUNGE-KUTTA Method! (A Simple Way To Solve)
31 min · ≈ 140 MB · about ₦79
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.