🌡️Boundary Value Problems and Partial Differential Equations
Hyperbolic Equations: Advection, Waves and the CFL Condition
Advection and wave equations, upwind, Lax–Friedrichs and Lax–Wendroff, the CFL condition, numerical diffusion and dispersion
1922: a forecast six weeks in the making
Lewis Fry Richardson — whom we met in Unit 4 relaxing stresses in a masonry dam — believed that weather could be forecast by computing the equations of fluid motion forward from today's observations. In 1922 he published Weather Prediction by Numerical Process and, as proof, a single forecast: starting from observations over central Europe at 7 a.m. on 20 May 1910, the conditions six hours later, computed by hand in the intervals of his service with an ambulance unit on the Western Front.
His forecast predicted that surface pressure would rise by 145 hPa in six hours — a change larger than any hurricane produces. In reality the pressure was almost steady. Richardson published the failure honestly. Decades later the meteorologist Peter Lynch showed that the method was sound and the trouble lay in unbalanced initial data, which excited fast gravity waves that the computation could not control.
In 1928 Richard Courant, Kurt Friedrichs and Hans Lewy in Göttingen proved the theorem that tells every wave computation how fast it is allowed to march. In 1950, respecting it, Jule Charney, Ragnar Fjørtoft and John von Neumann ran the first successful numerical forecast on ENIAC.
Hyperbolic equations describe things that travel at finite speed. The simplest is advection, : any initial profile moves at speed without changing shape, . A pollutant carried by a river, a temperature front in a pipe, a density wave in traffic. The wave equation — a vibrating string, sound, a pressure surge in a penstock — consists of two advections in opposite directions. Hyperbolic solutions keep their sharp features: a shock or a step does not smooth out. That is exactly what makes them hard to compute.
💡The CFL condition
In time the true solution at depends on data a distance upstream. An explicit scheme computes from neighbours within a few . If the physical dependence reaches further than the numerical stencil, the scheme cannot possibly be right, and in fact it is unstable. For a one-point-each-side stencil this gives the Courant–Friedrichs–Lewy condition:
is the Courant number. Note the difference from diffusion: , not . The condition is necessary for every explicit scheme; it is not sufficient — a scheme can satisfy CFL and still be unstable (centred differences in space with forward Euler in time are unstable for any ).
Derivation
The exact solution, and why upwind is stable but centred is not
Translation solves it. For the chain rule gives and , so for any profile .
Upwind. Insert the Fourier mode (lesson 10-2) into :
Its squared size, after expanding and using :
Since , for every mode exactly when : , the CFL condition.
Centred differences with forward Euler, , give
every mode grows, at any Courant number. Satisfying CFL is not enough.
Two classic explicit schemes for u_t + a u_x = 0 (a > 0). Upwind takes its difference from the side the information comes from; first order. Lax–Wendroff adds a second-derivative correction from the Taylor series in time; second order. Both are stable for C ≤ 1.
Derivation
Lax–Wendroff from a Taylor series in time, and what upwind really solves
Lax–Wendroff. Step forward in time with two Taylor terms, , and use the equation itself to turn time derivatives into space derivatives: , and differentiating again, . So
Replace by the central difference and by the second difference . With the coefficients become and — the formula above.
The modified equation of upwind. Ask which equation the upwind scheme solves exactly to the next order. Expand both differences by Taylor: and . The scheme says their weighted sum is zero:
using once more. The right side is a diffusion term with coefficient : upwind computes advection plus artificial diffusion, which is the smearing. It vanishes at , where upwind shifts the data exactly one cell per step.
💡Numerical diffusion and dispersion
Modified-equation analysis shows what each scheme actually solves. Upwind solves advection plus a diffusion term : it smears. Carrying a square pulse once around a periodic domain at , each sharp edge is spread over 0.18 of the domain; at over 0.10; at exactly upwind is exact (it shifts by one cell per step). Lax–Wendroff's leading error is a third derivative — dispersion: different wavelengths travel at slightly different speeds, so a smooth Gaussian is carried with error 0.1 but a square pulse grows ripples that overshoot to 1.23 and undershoot to −0.23. A negative concentration of pollutant is not a small error; it is nonsense. Modern high-resolution schemes (flux limiters, Godunov, WENO) switch between the two behaviours to keep fronts sharp without oscillations.
Young man, in mathematics you don't understand things. You just get used to them.
📐A plucked string
A guitar string 0.65 m long with wave speed 120 m/s (fundamental 92.3 Hz), plucked 3 mm at a quarter of its length, stepped with the centred leapfrog scheme. At the scheme is exact for the wave equation: after one period the shape returns to within mm. At it returns with a 0.03 mm error from dispersion. At — one percent over the limit — it blows up to mm in a single period.
Derivation
The leapfrog scheme for the wave equation, and why is exact
The scheme. Replace both second derivatives in by second differences (lesson 3-3), one in time and one in space:
Solve for the new value, with :
It needs two time levels, like a two-step method (lesson 9-3). To start from rest, the fictitious is set equal to , which gives a first step with half the second difference — the lab's hint.
Why is exact. Then the terms cancel and the scheme is . Every solution of the wave equation is a sum of two travelling waves, (d'Alembert). With , a wave moving right moves exactly one cell per step, so at equals at , and also at equals at ; together these make the formula hold exactly for , and likewise for . Any other makes waves of different lengths travel at slightly different speeds — the dispersion seen at — and violates the CFL condition.
💡Where you will use this
CFD and Aerodynamics: the Euler and Navier–Stokes equations are hyperbolic in their convective part; every explicit solver chooses its time step from a CFL number. Rocket Propulsion: unsteady nozzle flow, combustion instability, water hammer in feed lines. Hydraulics: river flood waves, dam-break flows and pressure surges in pipelines (method of characteristics). Structures: impact and blast analysis with explicit dynamics, where the time step is set by the fastest wave in the smallest element.
📚Further reading
- Randall LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations (SIAM, 2007), chapter 10, 'Advection Equations and Hyperbolic Systems' — upwind, Lax–Wendroff, modified equations and the CFL condition.
- Randall LeVeque, Finite Volume Methods for Hyperbolic Problems (Cambridge University Press, 2002) — high-resolution methods that keep fronts sharp without ripples.
- Peter Lynch, The Emergence of Numerical Weather Prediction: Richardson's Dream (Cambridge University Press, 2006) — Richardson's forecast recomputed, and why it failed.
↓But there is a problem
Diffusion and waves both evolve in time. A great deal of engineering asks about the state that remains after everything has settled: the steady temperature in a heat sink, the stress in a loaded bracket, the pressure in groundwater flowing steadily under a dam. Time disappears, and every point balances its neighbours at once.
On 5 June 1976 the Teton Dam in Idaho, newly completed, was filling for the first time. In the morning muddy water appeared at the downstream face. By noon a hole had eaten through the embankment, and the dam collapsed, sending a flood down the valley that killed eleven people. The water had found a path through the soil — a path governed by Laplace's equation.