The condition a wave equation imposes
What this page answers
The class page says a hyperbolic problem carries its answer along paths at a finite speed, and that a scheme has to respect that speed. It states the condition. This page derives it from the domain of dependence, measures what happens on each side of it, and says why the boundary case is exact rather than merely stable.
This closes the derivation row of the measured gaps for the third class, and it gives the condition a reason rather than a name.
The mathematics
Take the simplest wave equation, with speed one:
Its exact solution is a travelling shape, : the value at is whatever was at the single point at time zero. That point is the equation's domain of dependence, and it is one point, not an interval, because the equation carries information at exactly one speed.
A scheme has its own domain of dependence. The explicit upwind scheme
computes the new value at node from the old values at and : it assumes the wave came from the left, which is why it is called upwind. After steps the value at node depends on nodes to , an interval of width for . The physical point sits inside that interval only when
That is the Courant–Friedrichs–Lewy condition, and the argument is the one worth remembering: a scheme cannot be right where it cannot see. If the exact answer at a point depends on data the scheme never read, no amount of accuracy in the arithmetic recovers it.
The same inequality comes out of von Neumann's analysis. Substituting into the scheme gives
and multiplying by the conjugate gives a magnitude that depends only on the real part:
For the bracket is never negative, so and the scheme is stable. For the coefficient is negative, the bracket turns positive for , and : the scheme amplifies. The two arguments agree, which is what a stability analysis of a linear constant-coefficient scheme should do.
The exact case. At , , whose magnitude is one for every . A magnitude of exactly one with a phase that is exactly the shift means the scheme does not merely approximate the shift. It performs it. Run it at and every node moves exactly one place per step, with no diffusion and no error at all. That is why the condition is not a nuisance to be pushed against. The boundary of the stable region is the one place where a first-order scheme is exact. A code that runs at near one is trading accuracy for speed in a way that is visible and rarely justified.
The check. Start with a single spike at node 20 of a 40-node grid and take ten steps. At the spike is smeared to a peak of at node 25 — stable, and diffusive. At it arrives at node 30 with its height intact: the exact shift. At the peak reaches , and it keeps doubling: the CFL condition is violated and the answer is arithmetic noise with a shape.
The code
The program runs the upwind scheme on that spike at three Courant numbers and prints the largest value and where it sits after ten steps.
Ten steps of upwind at three Courant numbers
def upwind(nu, n=40, steps=10):
"""u_t + a u_x = 0 with a = 1, one step of explicit upwind."""
u = [1.0 if i == 20 else 0.0 for i in range(n)]
for _ in range(steps):
v = u[:]
for i in range(1, n):
u[i] = v[i] - nu * (v[i] - v[i - 1])
return u
print("nu max|u| peak at")
for nu in (0.5, 1.0, 1.5):
u = upwind(nu)
peak = max(range(40), key=lambda i: abs(u[i]))
print(f"{nu:>3} {max(abs(x) for x in u):>8.2f} {peak}")
nu max|u| peak at
0.5 0.25 25
1.0 1.00 30
1.5 288.33 28
The peak's position is the wave speed, and it is the first thing to check in a hyperbolic code. At the peak has moved five nodes in ten steps. At it has moved ten, which is the physical speed. The height is the second: at is the exact shift, and at is the numerical diffusion that the same algebra predicts. The third row has the position roughly right and the height meaningless, which is what an unstable run looks like before it overflows.
The theory
The condition came from a domain of dependence, and that argument generalises further than the scheme.
- It is about the equation, not the method. Any explicit scheme for a hyperbolic problem has a finite stencil and therefore a finite domain of dependence. The CFL condition says the physical one must fit inside it, so the limit on survives a change of scheme — only the constant changes.
- Implicit schemes evade it, and pay elsewhere. An implicit stencil reaches every node at once, so it has no CFL limit; it is stable at any and still inaccurate when the step is too large to resolve the wave, because the answer is then a smoothed version of the right answer. Stability and accuracy are different requirements and the CFL condition is about the first.
- Upwind is first order and diffusive. The magnitude for is numerical dissipation: the scheme damps the wave it should carry unchanged. That is the price of a one-sided stencil, and Lax–Wendroff buys second order at the cost of oscillations behind a front.
The wave speed is not always given. In a system, is replaced by the eigenvalues of a Jacobian, and the condition is that every one of them satisfies it. So the step is set by the fastest wave, whether or not the answer contains it. That is the same stiffness that the parabolic page meets from the other direction. Roache's book is the standard account of why the condition is a stability condition and not only a bookkeeping rule, and LeVeque's develops the domain-of-dependence argument for systems.
What it will not do: it will not tell you the step for a nonlinear conservation law, where waves can steepen into shocks and the relevant speed depends on the solution.
What this cost
One pass over the nodes per step, so a fixed final time costs work with tied to . Halving the mesh doubles the nodes and doubles the steps, so the work goes up fourfold. That is cheaper than the parabolic case's eightfold, because the time step is tied to rather than to .
Memory is . Accuracy is first order in both and for this scheme, so the error falls linearly with the mesh — one digit for a tenfold refinement, where the centred schemes get two.
What it will not do: it will not carry a wave unchanged unless . It will not stay stable if the boundary condition lets a wave back in. A stable interior with a reflecting boundary one step out of phase is a common way to see an explosion the CFL analysis says cannot happen.
Back to the map
Hyperbolic is the class page this works under. The same argument for a diffusive equation is the same condition with a different power. Home is the summary.