UNIHIVE

Study Hub UNIPORT MTH 492

MTH 492 · Numerical Methods

Hyperbolic equations: the wave equation

The explicit scheme for vibrating strings, the CFL condition, and first-order advection.

Our notes

2 min read

The explicit scheme

For u_tt = c² u_xx, central differences in both time and space give
uᵢⁿ⁺¹ = 2(1 − p²)uᵢⁿ + p²(uᵢ₋₁ⁿ + uᵢ₊₁ⁿ) − uᵢⁿ⁻¹, with p = ck/h (the Courant number).
Error O(k² + h²).

The CFL condition

The scheme is stable only if p ≤ 1 (Courant-Friedrichs-Lewy). Physically: in one time step the true wave travels ck; the numerical scheme only "sees" a distance h, so it must include the true domain of dependence: ck ≤ h.

Starting off

The scheme needs two old levels. With initial position f(x) and velocity g(x):
uᵢ¹ = uᵢ⁰ + k gᵢ + (p²/2)(uᵢ₋₁⁰ − 2uᵢ⁰ + uᵢ₊₁⁰)
(from a Taylor expansion and the PDE). With g = 0 and p = 1: uᵢ¹ = (uᵢ₋₁⁰ + uᵢ₊₁⁰)/2.

Worked example

A string fixed at both ends, u_tt = u_xx (c = 1), u(x, 0) = sin πx, released from rest. Exact u = cos πt sin πx. Take h = k = 0.25 (p = 1).

  • t = 0: u = (0, 0.70711, 1, 0.70711, 0)
  • t = 0.25: u₁ = (0 + 1)/2 = 0.5; u₂ = (0.70711 + 0.70711)/2 = 0.70711
  • Exact at t = 0.25: cos(π/4) × sin(π/4) = 0.5 and cos(π/4) × 1 = 0.70711. ✓

With p = 1 the scheme is exact for the 1D wave equation: the grid lines are the characteristics x ± t = constant. With p < 1 there is a small error; with p > 1 the solution blows up.

Next step (p = 1)

uᵢⁿ⁺¹ = uᵢ₋₁ⁿ + uᵢ₊₁ⁿ − uᵢⁿ⁻¹. At t = 0.5, the middle node: 0.5 + 0.5 − 1 = 0, matching cos(π/2) = 0. ✓

First-order advection

u_t + a u_x = 0 (a > 0: a pulse moving right at speed a).

  • Upwind scheme: uᵢⁿ⁺¹ = uᵢⁿ − ν(uᵢⁿ − uᵢ₋₁ⁿ), ν = ak/h ≤ 1. Stable, but smears sharp fronts (numerical diffusion).
  • Lax-Wendroff: second order, sharper, but wiggles near jumps.
  • FTCS (forward time, centred space) is unstable for every k: a famous trap.

Where it is used

Seismic waves (petroleum geophysics), acoustics, transmission lines, traffic and flood waves.

Exams usually ask

  • Carry out two time steps for a plucked string.
  • State and explain the CFL condition.

Common mistake

Using the explicit wave scheme for the first step without the special starting formula. The general formula needs uᵢ⁻¹, which does not exist.

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.