4.8.23 · D3Numerical Methods

Worked examples — Modified Euler (Heun's method)

2,206 words10 min readBack to topic

A tour through every kind of problem Heun's method can be handed — flat starts, decreasing solutions, big steps, multi-step marches, iterated correctors, and exam twists. Guess the answer first, then watch it fall out.

Before we begin, the one formula we lean on the whole page (built from scratch in the parent note):


The scenario matrix

Every problem this method can throw lives in one of these cells. The examples below are labelled with the cell(s) they cover.

# Case class What makes it special Example
A Positive growing slope , curve bends up Ex 1
B Zero start-slope , Euler would freeze Ex 2
C Negative / decaying slope , curve bends down Ex 3
D Large step big → predictor is far off, tests robustness Ex 4
E Multi-step march Repeat the recipe, feed into next step Ex 5
F Iterated corrector Recycle output to solve the implicit equation Ex 6
G Real-world word problem Units, cooling in the real world Ex 7
H Exam twist: depends on only Heun collapses to the pure Trapezoidal Rule Ex 8

We will visit every cell. No scenario is left unshown.


Ex 1 — Cell A: positive growing slope

Figure — Modified Euler (Heun's method)

Ex 2 — Cell B: zero start-slope

Figure — Modified Euler (Heun's method)

Ex 3 — Cell C: negative decaying slope


Ex 4 — Cell D: large step


Ex 5 — Cell E: multi-step march


Ex 6 — Cell F: iterated corrector


Ex 7 — Cell G: real-world word problem (units!)


Ex 8 — Cell H: exam twist — depends on only


Recall Which cell did each example cover?

Which example proves Heun = Trapezoidal Rule when has no ? ::: Ex 8 (Cell H). Which example shows a large step blowing up the error? ::: Ex 4 (Cell D), and also Ex 7's cooling. Which example has a zero start-slope that would freeze plain Euler? ::: Ex 2 (Cell B). Which example marches multiple steps forward? ::: Ex 5 (Cell E), two steps of . Which example iterates the corrector? ::: Ex 6 (Cell F).


Connections

  • Modified Euler (Heun's method) — the parent recipe every example applies.
  • Euler's Method — the predictor step in every example above.
  • Trapezoidal Rule — literally is Heun in Ex 8.
  • Order of Accuracy and Step Size — explains Ex 4 vs Ex 5 (big vs small ).
  • Predictor-Corrector Methods — the iterated corrector of Ex 6.
  • Runge-Kutta Methods — every example is secretly RK2.