UNIHIVE

Study Hub UNIPORT MTH 492

MTH 492 · Numerical Methods

The heat equation: the explicit scheme and stability

Forward-time centred-space differences, the r ≤ ½ rule, and why schemes blow up.

Our notes

2 min read

The scheme

For u_t = u_xx (taking α = 1), replace u_t by a forward difference and u_xx by a central one:
(uᵢⁿ⁺¹ − uᵢⁿ)/k = (uᵢ₋₁ⁿ − 2uᵢⁿ + uᵢ₊₁ⁿ)/h²
uᵢⁿ⁺¹ = r uᵢ₋₁ⁿ + (1 − 2r) uᵢⁿ + r uᵢ₊₁ⁿ, with r = k/h².
Each new value comes explicitly from three old ones: no system to solve. Error O(k + h²).

Stability

The scheme is stable only if r ≤ ½. With r = ½ it becomes uᵢⁿ⁺¹ = (uᵢ₋₁ⁿ + uᵢ₊₁ⁿ)/2: the average of the two neighbours.

Von Neumann analysis: put uᵢⁿ = Gⁿ e^{iβih}. Then G = 1 − 4r sin²(βh/2). Stability needs |G| ≤ 1 for every β, giving r ≤ ½.

Worked example

u_t = u_xx, 0 < x < 1, u(0, t) = u(1, t) = 0, u(x, 0) = sin πx. Exact u = e^{−π²t} sin πx. Take h = 0.25, r = ½, so k = 0.03125.
Start: u = (0, 0.70711, 1, 0.70711, 0).

  • Step 1 (t = 0.03125): middle = (0.70711 + 0.70711)/2 = 0.70711; sides = (0 + 1)/2 = 0.5. So u = (0, 0.5, 0.70711, 0.5, 0). Exact middle: 0.7346.
  • Step 2 (t = 0.0625): middle = (0.5 + 0.5)/2 = 0.5; sides = 0.70711/2 = 0.35355. Exact middle: 0.5396.

The shape stays a sine and decays, as it should; the error comes from the coarse h.

What instability looks like

Take r = 1 and a jagged start (0, 1, −1, 1, 0). The update is uᵢ₋₁ − uᵢ + uᵢ₊₁:

  • Step 1: (0, −2, 3, −2, 0)
  • Step 2: (0, 5, −7, 5, 0)

The values grow and swap sign each step: rounding errors (which are always jagged) would do the same. The true solution only decays.

Check step 1, middle node: the neighbours are 1 and 1 and the node is −1, so 1 − (−1) + 1 = 3. ✓

The cost of explicit stability

k ≤ h²/2: halving h forces a quarter of the time step, so four times the steps on twice the nodes: eight times the work. This drives us to implicit schemes.

Lax equivalence theorem

For a consistent linear scheme, stability ⇔ convergence. Consistency alone is not enough.

Exams usually ask

  • Carry out two time steps of the explicit scheme.
  • Derive the stability condition by von Neumann analysis.

Common mistake

Choosing k without checking r. Work out r = k/h² first; if it is above ½, the answers are meaningless.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

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.

All MTH 492 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.