MATH 4810 Computational Modelling

Module 02 · Unit 2.2

Runge–Kutta and Adaptive Reasoning

Fourth-order Runge–Kutta is the workhorse of deterministic simulation. This unit covers its derivation, implementation, and the practical questions of step-size selection and method limitations.

3 lessons ≈ 9 hours Laboratory 4 Feeds Assignment 2
  1. Unit 2.1
  2. Unit 2.2

§ Overview

Fourth-order Runge–Kutta is the default method for non-stiff initial-value problems. It achieves fourth-order accuracy with four evaluations of f per step, and it is straightforward to implement. This unit develops the method, the numerical practice of verifying its order, and the practical questions of step-size selection and method limitations.

The closing lesson addresses stiffness. Some problems force explicit methods to take impractically small steps, and recognising this situation is as important as knowing how to implement the method. The unit treats stiffness as an awareness topic — it identifies the phenomenon and its consequences rather than developing implicit methods in detail.

Lesson 1

Fourth-order Runge–Kutta method

Lesson 2

Step-size selection and convergence

Lesson 3

Stiffness awareness and method limitations

Laboratory 4

Runge–Kutta modelling

§ Learning outcomes

By the end of Unit 2.2 you will be able to

  • Derive and implement the classical fourth-order Runge–Kutta method.
  • Perform a convergence study and estimate the observed order of a method from numerical data.
  • Select an appropriate step size for a given accuracy requirement.
  • Recognise stiffness in a problem and explain why explicit methods become impractical.
  • Choose between Euler, second-order, and fourth-order methods based on accuracy, cost, and problem structure.

§ Lessons

§ Classical Runge–Kutta

The classical fourth-order Runge–Kutta method advances the solution from (t_n, y_n) to t_{n+1} = t_n + h using four stage evaluations:

k₁ = f(t_n, y_n)
k₂ = f(t_n + h/2,  y_n + (h/2) k₁)
k₃ = f(t_n + h/2,  y_n + (h/2) k₂)
k₄ = f(t_n + h,    y_n + h k₃)

y_{n+1} = y_n + (h/6) ( k₁ + 2 k₂ + 2 k₃ + k₄ )

The weights (1, 2, 2, 1) / 6 are chosen so that the Taylor expansion of the numerical step matches the exact solution through terms of order h⁴. The result is a method whose global error scales as O(h⁴) — a substantial improvement over Euler's O(h), at four evaluations per step rather than one.

Stage structure of classical Runge–Kutta Four stage evaluations labelled k1 through k4 are shown as vertical bars in sequence. k1 evaluates f at the start of the step. k2 and k3 evaluate f at the midpoint using estimates from k1 and k2. k4 evaluates f at the end of the step using an estimate from k3. A weighted sum of the four stages produces the next value y_{n+1}. t_n t_n + h t_n + h/2 k₁ f(t_n, y_n) k₂ midpoint k₃ midpoint k₄ endpoint y_{n+1} = y_n + (h/6)( k₁ + 2k₂ + 2k₃ + k₄ )
Figure 2.2. Stage structure of classical fourth-order Runge–Kutta. Four evaluations of f are combined with weights 1, 2, 2, 1 to advance one step.

Why order four is the practical sweet spot

Higher-order methods exist — order five, six, and beyond — but the number of required stage evaluations grows faster than the order. The classical fourth-order method achieves a good balance: four evaluations per step for O(h⁴) accuracy. When higher accuracy is needed, reducing the step size in RK4 is usually more effective than switching to a higher-order method.

§ Stiffness

Some initial-value problems contain multiple time scales: one component evolves rapidly, while the solution of interest evolves slowly. Problems of this kind are called stiff.

Stiffness has a practical consequence for explicit methods. Stability requires a step size small enough to resolve the fastest time scale, even when that scale is irrelevant to the quantity being computed. The integration then takes far more steps than the accuracy requirement alone would demand.

Practical consequences of stiffness
Symptom Explanation
Step size far smaller than accuracy requires Stability, not accuracy, is limiting the step.
Output changes negligibly over many steps The fast transient has decayed, but the method cannot exploit this.
Small increases in step size cause instability The method crosses a stability threshold.
Runtime dominated by step-count overhead The cost is per-step, not per-unit-time, and the step count is huge.

This unit treats stiffness as an awareness topic. Recognising a stiff problem is the first step; addressing it in practice requires implicit methods, which are beyond the scope of this course.

Recognising stiffness

If a small reduction in step size produces a large change in the numerical solution, or if the step size required for stability is much smaller than the step size required for accuracy, the problem is stiff. Reducing the step further does not solve this; it only postpones the problem at the cost of runtime.

§ Key terms

Stage evaluation
A single evaluation of the derivative function f at an intermediate point within a step. Runge–Kutta methods are characterised by the number of stages per step.
Butcher tableau
A compact tabular representation of a Runge–Kutta method, listing the stage coefficients, weights, and node positions.
Observed order
The exponent estimated numerically from a convergence study. It should agree with the theoretical order of the method to within numerical precision.
Adaptive step size
A strategy in which the step size is adjusted during integration based on a local error estimate. Common in production ODE solvers.
Stiff system
A system of ODEs whose components evolve on widely separated time scales. Explicit methods require very small steps for stability regardless of accuracy requirements.
Stability region
The set of hλ values for which a method applied to the test equation y' = λy produces a bounded numerical solution. A method is stable for a problem if the relevant hλ lies inside its stability region.

§ Self-check

Check your understanding

Question 1

How many evaluations of the derivative function f does classical fourth-order Runge–Kutta require per step?

Show answer

Four. The four stages k₁ through k₄ each evaluate f once, at different points within the step. These evaluations are then combined with weights 1, 2, 2, 1 to produce the update.

Question 2

Halving the step size in a numerical experiment reduces the global error by a factor of about 15. The observed order of the method is closest to:

Show answer

4. The error reduction factor is approximately 2p, where p is the order. Since 2⁴ = 16, an observed factor of about 15 indicates fourth-order behaviour. A factor of 4 would correspond to p = 2, and 32 to p = 5.

Question 3

A stiff initial-value problem is one in which:

Show answer

Components evolve on widely separated time scales, forcing small steps for stability. Stiffness is a property of the problem, not of the method. Explicit methods are constrained by the fastest time scale, even when that scale is not relevant to the quantity of interest. Implicit methods remove this constraint but are outside the scope of this course.

👤