advanced32 min studyLesson 925 in Physics

Finite-difference wave propagation and CFL

Derive a centered wave update, initialize it consistently and identify its particular stability and dispersion limits.

On this page

What you’ll understand

  • Perform two explicit wave updates on a tiny periodic grid.
  • Derive the Courant restriction for the stated one-dimensional scheme.
  • Separate stable propagation from accurate wave speed and boundary behavior.

A finite-difference wave calculation replaces continuous derivatives by relations among neighboring samples. A short spatial wavelength then interacts with the grid very differently from a smooth, well-resolved pulse. The Courant condition limits time stepping for a particular method, but satisfying it does not guarantee the correct phase speed or boundary reflections. We use a constant-speed one-dimensional wave equation on a uniform grid, making its initial displacement, initial velocity and spatial boundary conditions explicit before assessing consistency, stability and convergence.

Discretize the initial-value problem completely

For displacement u and positive wave speed c, replace both second derivatives by centered differences. The resulting update uses two previous time levels, so initial displacement alone cannot start it. A Taylor expansion using the prescribed initial velocity and the wave equation produces a consistent first time level. The discrete spatial Laplacian in this initialization must respect the same boundary convention as later steps. Treating a missing neighbor as zero when the model is periodic changes the problem.

A periodic grid wraps the last point back to the first and contains no distinct duplicated endpoint. Fixed Dirichlet ends instead prescribe displacement at the boundary, while a Neumann end requires a consistent derivative stencil. Ghost cells are one implementation device, not new physical particles. Even if an interior formula is second order, a boundary or startup error can control the observed accuracy. Declare the entire initial-boundary-value problem rather than attach a boundary rule after inspecting the animation.

ujn+1=2ujn−ujn−1+C2(uj+1n−2ujn+uj−1n),C=cΔtΔx,uj1=uj0+Δt vj0+C22(uj+10−2uj0+uj−10)u_j^{n+1}=2u_j^n-u_j^{n-1}+C^2(u_{j+1}^n-2u_j^n+u_{j-1}^n),\quad C=\frac{c\Delta t}{\Delta x},\quad u_j^1=u_j^0+\Delta t\,v_j^0+\frac{C^2}{2}(u_{j+1}^0-2u_j^0+u_{j-1}^0)
u is displacement, v0 its initial time derivative, Δx length and Δt time. The first-step formula shown assumes the unforced constant-c wave equation and a compatible spatial stencil.↔ Scroll wide equations horizontally.

Find the amplification relation for this stencil

On an infinite or periodic uniform grid, translation invariance allows a single Fourier grid mode to be examined independently. Substituting its spatial oscillation and temporal amplification factor produces a quadratic equation for that factor. For the central one-dimensional wave update, the usual Courant limit is one. Above it, a sufficiently short resolved wave has an exponentially growing branch, so roundoff or a small startup perturbation can seed an instability even when the intended initial pulse looks smooth.

The precise condition belongs to this equation and discretization. Higher dimensions, nonuniform grids, variable coefficients and different time methods alter it. At the endpoint one should also initialize compatible displacement and velocity carefully; repeated-root modes need the proper stability interpretation. Using a strict margin below the limit is a practical choice, not a replacement for analysis. A domain-of-dependence argument gives a necessary restriction for many explicit methods, but by itself does not prove every scheme stable.

g+g−1=2−4C2sin⁡2(θ/2),0<C≤1for the standard 1D centered wave schemeg+g^{-1}=2-4C^2\sin^2(\theta/2),\qquad 0<C\le1\quad\text{for the standard 1D centered wave scheme}
θ is dimensionless grid phase, and g is temporal amplification. This Fourier criterion assumes the translation-invariant scheme with compatible initialization; physical boundary treatments require additional analysis.↔ Scroll wide equations horizontally.

Separate stability from phase accuracy and convergence

A stable mode can travel at the wrong numerical speed. Its frequency obeys a sine relation instead of the continuum linear relation, so short wavelengths acquire different phase errors. For smooth solutions the centered derivative consistency error is second order in time and space. Stability plus consistency implies convergence only under the relevant well-posed linear problem and norm assumptions, including compatible boundaries and startup. These concepts should not be collapsed into the statement that a small step makes every calculation correct.

Refining space while leaving time fixed can expose temporal error, whereas reducing time alone cannot resolve a spatially under-sampled wave. Compare at the same physical time and examine a norm or phase observable appropriate to the problem. The waves lab adds two exact same-frequency sine waves. It can demonstrate cancellation and superposition, but has no spatial mesh, Courant number or numerical dispersion; it cannot display this difference scheme becoming unstable.

sin⁡2 ⁣(ω~Δt2)=C2sin⁡2 ⁣(kΔx2),ωcontinuum=ck\sin^2\!\left(\frac{\widetilde\omega\Delta t}{2}\right)=C^2\sin^2\!\left(\frac{k\Delta x}{2}\right),\qquad \omega_{\rm continuum}=ck
k has inverse-length units and both frequencies have inverse-time units. The discrete relation describes this constant-coefficient stencil; matching a stable frequency is a separate accuracy question.↔ Scroll wide equations horizontally.

Two steps on three periodic sites

Use a three-site periodic grid with u0 = (0,1,0) in one displacement unit, zero initial velocity and C = 0.50. Compute the consistent first level and then the second level. Check the sum of displacements.

  1. The wrapped discrete second difference of u0 is (1, −2, 1). The startup coefficient is C²/2 = 0.125, giving u1 = (0.125, 0.75, 0.125).

  2. The second difference of u1 is (0.625, −1.25, 0.625). Substitute it into the two-level recurrence with C² = 0.25 and subtract the original u0.

  3. This gives u2 = (0.40625, 0.1875, 0.40625). All three levels have displacement sum one. That preserved sum follows from periodic telescoping and zero mean initial velocity; it does not establish exact conservation of the continuum wave energy.

The result

u1 = (0.125, 0.75, 0.125) and u2 = (0.40625, 0.1875, 0.40625); both sums equal one.

Explore the model

Interactive lab

Interactive lab · waves

Superposition as an analytic reference

Reset and set BOTH Phase difference = 0° and Amplitude ratio = 1; predict a sum with twice either component amplitude. Reset and set Phase difference = 180° and Amplitude ratio = 1; predict cancellation up to floating-point precision. These are analytic same-frequency waves, with no finite-difference grid, numerical time step or adjustable dispersion.

Superposition as an analytic referenceTwo waves share the same frequency and wave number. Playback advances t in sin(2x − t) + a sin(2x − t + phase). Current readings: Sum at x = 0: 0.866; Resultant amplitude: 1.732; Phase difference: 60°. All parameters are adjustable with the labeled controls below.−3.14−1.5701.573.14−3.4−1.701.73.4x · radiansAmplitude
SumFirst componentSecond component
Sum at x = 0
0.866
Resultant amplitude
1.732
Phase difference
60°
t = 0 s

Two waves share the same frequency and wave number. Playback advances t in sin(2x − t) + a sin(2x − t + phase). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forAn analytic superposition check is useful, but it does not verify a mesh stability limit.

Check your understanding

For the specified centered one-dimensional constant-speed wave scheme, what does C below one establish by itself?

Try it yourself

Let Δx = 0.10 m and c = 2 m/s. Find the usual maximum step from C ≤ 1. If Δt = 0.06 s is used on an even periodic grid, evaluate g + g⁻¹ for the Nyquist mode θ = π and explain the consequence.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

At θ = π the squared sine is one. A real right-hand side below −2 makes the two amplification roots reciprocal, with one outside the unit circle.

Compare with the solution

The Courant limit gives Δt ≤ 0.05 s. The proposed 0.06 s step has C = 1.2, and the Nyquist relation is g + g⁻¹ = 2 − 4(1.44) = −3.76. Its roots are approximately −0.2880 and −3.4720, so one mode grows in magnitude each step. The instability can be seeded by a tiny error. This Nyquist example uses an even grid; the preceding three-site hand calculation has a different finite set of grid modes and is not the source of this particular mode.

Take it with you

  • The startup step and boundary rules complete the discrete wave problem.
  • A Courant restriction is specific to a scheme and geometry.
  • Stable modes can still have significant phase error.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.