MTH3007b Lecture 3

Me, in the lecture

zzzzz…

Lecture 2 introduced the midpoint and Ralston methods as second-order alternatives to explicit Euler, with global error . This session derives the conditions that make a two-stage RK method second-order, presents the fourth-order Runge-Kutta formula (RK4), and then introduces symmetric methods and the Implicit Trapezoid Method as a practically useful symmetric scheme.

Derivation of Second-Order RK Coefficients

General Two-Stage Form

Write a general two-stage explicit RK method as

The four parameters are , , , .

Taylor Expansion Matching

Expanding in a Taylor series about and comparing with the Taylor expansion of the exact solution , matching coefficients of , , and yields three conditions:

Important

Three equations in four unknowns - one free parameter. The family of second-order RK methods is a one-parameter family.

Special Cases

Setting the free parameter gives specific methods:

  • Midpoint method: , ,
  • Ralston’s method: , ,

Both satisfy the three coefficient equations, confirming they are second-order.

RK4 - The Fourth-Order Method

RK4 (the classical fourth-order Runge-Kutta method) uses four stages:

Important

RK4 is a fourth-order method: global error . Halving reduces the error by a factor of 16. Four -evaluations per step.

Symmetric Methods

Definition

A numerical method is symmetric (or time-reversible) if running the method forward by one step and then backward by one step returns exactly to the starting point. More precisely, a method is symmetric if

Why Symmetry Matters

Symmetric methods preserve certain geometric properties of the exact flow, in particular they tend to conserve energy-like quantities over long integrations. This makes them preferable for problems in mechanics and other settings where conservation matters.

Explicit Euler is Not Symmetric

The explicit Euler step forward gives . Applying the method backward from with step :

This is not equal to in general - explicit Euler is not symmetric.

Implicit Trapezoid is Symmetric

The Implicit Trapezoid Method (also called the trapezoidal method) averages the right-hand side at both endpoints:

Important

The implicit trapezoid method is symmetric: applying the method with from recovers exactly.

This can be verified by swapping and in the update rule - the equation is invariant under this exchange.

Other Preserved Quantities

symplectic methods (Verlet integrators and their relatives) preserve the symplectic structure of Hamiltonian systems exactly. These are not covered in this module - they exist and are important in molecular dynamics and celestial mechanics, but we do not derive or implement them here.

Heun’s Method Vs Implicit Trapezoid

Warning

Heun’s method (also called the explicit trapezoid method) is NOT the same as the implicit trapezoid method. Heun’s method is an explicit predictor-corrector that approximates using an Euler predictor step, then averages. The implicit trapezoid solves for simultaneously - it is a genuinely implicit method.

The distinction matters for stability: the implicit trapezoid is unconditionally stable for suitable equations, while Heun’s method (being explicit) is only conditionally stable.

Implicit Trapezoid: Worked Example

Problem:

With , the implicit trapezoid equation becomes:

Expanding and collecting terms:

Noting that :

The Python implementation of this single update step is:

Python
Output

Pre-Lecture Notes from University Notes

  • 2nd-order RK coefficients: Taylor expansion matching gives three equations in four unknowns (, , ); one free parameter
  • Midpoint: ; Ralston:
  • RK4: four-stage method, global error ; update uses weighted sum
  • Symmetric method: ; preserves time-reversal symmetry; explicit Euler fails this, implicit trapezoid passes
  • Symplectic methods (e.g. Verlet) preserve Hamiltonian structure - not covered here
  • Heun’s method is the explicit trapezoid - NOT the same as implicit trapezoid; Heun is conditionally stable, implicit trapezoid is unconditionally stable
  • Implicit trapezoid for :
  • Next session: formal stability analysis, Richardson method, and systems of ODEs