Fundamentals / Numerical mathematics / Numerical partial differential equations

Wave speeds and numerical dispersion

Derive the leapfrog dispersion relation, use the Courant condition to distinguish boundedness from accurate travel time and initialise a standing-wave calculation consistently.

From first principles

Derive the numerical wave dispersion relation by advancing a single mode

Consider a one-dimensional homogeneous wave with speed \(c\), uniform spatial grid \(h\) and time increment \(\Delta t\). Centred second differences approximate both accelerations and spatial curvatures using the values on either side of their evaluation point. The governing equation \(u_{tt}=c^2u_{xx}\) becomes

\[u_j^{n+1}-2u_j^n+u_j^{n-1}=C^2(u_{j+1}^n-2u_j^n+u_{j-1}^n),\]
\[C=c\Delta t/h .\]

To determine what the grid does to one travelling component, insert \(u_j^n=e^{i(kjh-\omega n\Delta t)}\) and divide by the value at \((j,n)\). In both directions the pair of opposite phases combines to a cosine. Using \(2-2\cos z=4\sin^2(z/2)\) then gives

\[\sin^2(\omega\Delta t/2)=C^2\sin^2(kh/2).\]

Long wavelengths recover \(\omega\simeq c|k|\). Short waves can propagate at a different phase speed even in a perfectly homogeneous physical medium. Requiring a real \(\omega\) for every resolved \(k\) gives \(C\le1\). This derivation concerns interior grid modes; domain boundaries can introduce reflected waves as a separate numerical effect.

Derivation and applications

Derive a conserved energy for the centred wave update

A time-stepping method can support a numerical travelling wave while transporting its phase at a slightly incorrect speed. For a second diagnostic, ask whether total discrete vibration energy remains bounded. Consider a uniform one-dimensional periodic grid for \(u_{tt}=c^2u_{xx}\), unit mass density and no forcing. Denote the forward spatial difference by \(D\) and the half-step velocity by \(v^{n+1/2}=(u^{n+1}-u^n)/\Delta t\). Summation by parts on this grid gives \(\langle v,D^\mathsf TD u\rangle=\langle Dv,Du\rangle\) using the grid inner product. The centred step can be written

\[v^{n+1/2}-v^{n-1/2}=-c^2\Delta t D^\mathsf TD u^n .\]

Take the inner product with \((v^{n+1/2}+v^{n-1/2})/2\). The left side becomes a difference of two kinetic energies. On the right use \(\Delta t(v^{n+1/2}+v^{n-1/2})=u^{n+1}-u^{n-1}\) and move \(D\) to the other factor:

\[E^{n+1/2}=E^{n-1/2},\]
\[E^{n+1/2}=\tfrac12\|v^{n+1/2}\|^2+\tfrac12c^2\langle Du^{n+1},Du^n\rangle.\]

The potential term couples consecutive time levels. Writing it in terms of the midpoint displacement \(\bar u=(u^{n+1}+u^n)/2\) identifies when the invariant bounds the solution:

\[E^{n+1/2}=\tfrac12\|v\|^2-\tfrac18 c^2\Delta t^2\|Dv\|^2+\tfrac12c^2\|D\bar u\|^2 .\]

Since \(\|Dv\|\le2\|v\|/\Delta x\), the kinetic part is bounded below by \((1-C^2)\|v\|^2/2\), with \(C=c\Delta t/\Delta x\). The invariant controls nonconstant waves for \(C<1\). An exact but indefinite conservation law alone would not guarantee a bounded numerical solution.

Worked example

Read a timestep from a material and grid

Take \(c=100\) m/s, \(\Delta x=0.0500\) m and \(\Delta t=0.400\) ms. Then \(C=0.800\) and the bound preserves at least \(1-C^2=0.360\) of the usual half-step kinetic term even in the worst spatial mode. The customary limiting step from this argument is \(0.500\) ms.

Second application

Show why equality of successive energies can mislead

Take the alternating grid mode for which \(\|Dv\|=2\|v\|/\Delta x\), and choose adjacent displacements whose midpoint is zero. At \(C=1.20\) the invariant for this state is

\[E=(1-1.44)\|v\|^2/2=-0.220\|v\|^2.\]

Negative energy here is a property of the numerical quadratic form. A solver can preserve it exactly and still exhibit amplitude growth.

Distinguish transport of phase from transport of energy

A taut string with small transverse displacements and fixed tension obeys \(u_{tt}=c^2u_{xx}\). The physical speed \(c\) is independent of wavelength in this ideal one-dimensional model. A discrete solver can transport long waves at nearly the correct speed while short waves arrive late. In a pulse comprising many wavelengths, this artificial dependence on frequency distorts its shape even in a stable computation. A phase comparison at a probe provides information beyond monitoring maximum amplitude.

Use centred second differences in both time and space, with \(C=c\Delta t/h\). Solving explicitly for the new level gives

\[u_i^{n+1}=2u_i^n-u_i^{n-1}+C^2(u_{i-1}^n-2u_i^n+u_{i+1}^n).\]

To initialise, expand \(u(\Delta t)=u(0)+\Delta t\,v(0)+(\Delta t)^2 c^2u_{xx}(0)/2+\cdots\). Replacing \(u_{xx}(0)\) by the same spatial difference gives a first level consistent with the initial velocity and acceleration. Simply copying the starting displacement to level one can introduce a spurious launch velocity.

Derive the discrete dispersion relation

Take a travelling mode \(u_i^n=\exp[\mathrm{i}(i\theta-n\omega_h\Delta t)]\) with spatial phase \(\theta=kh\). Inserting it makes the temporal second difference proportional to \(-4\sin^2(\omega_h\Delta t/2)\) and the spatial second difference proportional to \(-4\sin^2(\theta/2)\). Thus on the positive-frequency branch

\[\sin(\omega_h\Delta t/2)=C\sin(kh/2).\]

A real \(\omega_h\) exists for all resolvable real spatial phases only when \(C\leq1\). If \(C>1\), the shortest wave makes the right-hand side exceed one; a temporal amplification root then lies outside the unit circle. Even when stable, the ratio of numerical to physical phase speed is \(2\arcsin[C\sin(\theta/2)]/(C\theta)\). A fine spatial sample makes \(\theta\) small and the ratio tends to one. At \(C=1\) the ideal uniform one-dimensional interior stencil reproduces the wave phase on the resolved branch. Boundaries, material transitions and multiple dimensions require separate analysis.

Long waves travel at the expected speed for all three Courant numbers; shorter grid waves slow appreciably below the unit Courant number.
Centred one-dimensional wave discretisation. A short wave remains stable for the illustrated Courant numbers while accumulating substantial phase error in two of the runs.

Estimate a travel-time error

Take \(C=0.5\) and four points per wavelength, so \(\theta=\pi/2\). Then

\[\omega_h\Delta t=2\arcsin[0.5\sin(\pi/4)]=0.72273\,\mathrm{rad}.\]

The physical advance is

\[C\theta=\pi/4=0.78540\,\mathrm{rad}.\]

The numerical phase speed is about 0.920 of the true speed. After ten physical periods, its accumulated phase is about 9.20 cycles. A stable solution can therefore be nearly one oscillation behind while retaining a visually plausible amplitude.

Group velocity is \(d\omega_h/dk\), obtained by differentiating the dispersion relation. On this branch \(v_g/c=\cos(\theta/2)/\sqrt{1-C^2\sin^2(\theta/2)}\), about 0.756 in the four-point example. A narrow-band packet’s envelope and an individual crest then propagate at different numerical speeds. When interpreting a probe trace, say whether the reported arrival corresponds to a crest, an envelope or a threshold. Repeat the calculation at additional points per wavelength using the same Courant number to isolate spatial-phase improvement from changes in the time integration.

Interpret the grid’s travelling domain of dependence

In one explicit wave step, a node uses only itself and its two nearest neighbours. After \(n\) steps its numerical domain of dependence extends at most \(n\) grid cells to either side. The continuous wave at the same time can depend on initial data a distance \(cn\Delta t\) away. For convergence that physical domain must fit inside the numerical one, giving \(c\Delta t\leq h\). This reproduces the Courant condition from geometry without inserting a Fourier mode. It is a necessary information-speed test; by itself it does not establish stability or accuracy of an arbitrary scheme.

As an example, with \(c=340\) m/s and \(h=0.01\) m, the step bound is about 29.4 microseconds. A 20 microsecond step satisfies it but need not give an accurate answer for a mode represented by only three or four points per wavelength. Time-of-flight information and wavelength resolution are related to different discretisation choices. Document both when comparing two wave calculations.

Derive a reflected wave from a discrete outgoing condition

For a one-dimensional wave travelling right at speed \(c\), the outgoing continuum condition is \(u_t+cu_x=0\) at the right boundary. It annihilates an exact right-travelling waveform. A numerical boundary update using forward time and backward space gives

\[u_N^{n+1}=(1-C)u_N^n+C u_{N-1}^n,\]

where \(C=c\Delta t/h\). A wave satisfying the interior discrete dispersion relation need not satisfy this one-sided relation. Even when the continuum boundary is perfectly absorbing, a mismatch of discrete phase relations can send energy back into the computational domain.

Let \(z=e^{-i\omega\Delta t}\), with the incident and reflected grid waves represented by \(e^{i\theta(j-N)}z^n\) and \(R e^{-i\theta(j-N)}z^n\). At the boundary their sum is \(1+R\) times \(z^n\). Substitution in the outgoing update and grouping incident and reflected terms gives

\[R=-\frac{z-1+C-Ce^{-i\theta}}{z-1+C-Ce^{i\theta}}.\]

This amplitude ratio assumes a homogeneous grid, a propagating frequency and distinct incident and reflected branches. It compares each wave at the boundary itself. Signals measured farther inward acquire additional phase and travel-time factors and can interfere if both arrive in the same observation window.

Calculate a reflection generated by numerical mismatch

Use the centred wave scheme with \(C=1/2\) and grid angle \(\theta=\pi/2\), four cells per wavelength. The interior relation gives \(\sin(\omega\Delta t/2)=(1/2)\sin(\pi/4)=1/(2\sqrt2)\), hence \(z=0.75-i\sqrt7/4\). The incident mismatch in the numerator is \(0.25-i(\sqrt7/4-0.5)\); the reflected denominator is \(0.25-i(\sqrt7/4+0.5)\). Squaring the magnitudes gives \((3-\sqrt7)/4\) and \((3+\sqrt7)/4\), respectively. Therefore \(|R|=\sqrt{(3-\sqrt7)/(3+\sqrt7)}\approx0.2505\). Roughly one quarter of the incident amplitude is reflected solely by this discrete boundary treatment.

For incident and reflected branches on the same symmetric grid, their group-speed magnitudes match. The corresponding reflected energy fraction is \(|R|^2\approx0.0627\), about six percent. That is small enough for a short experiment to appear satisfactory until the pulse returns to a sensor. Testing only the incident travel time would miss this boundary error. Compare a time window before reflection with the expected window for the return journey.

At \(C=1\) and \(0<\theta<\pi\), the right-moving interior root is \(z=e^{-i\theta}\). The numerator vanishes exactly and the boundary update transmits that branch without reflection. This exact compatibility is special to this one-dimensional grid, this step size and this outgoing condition. Varying the propagation angle in two dimensions, changing an interface spacing or using a higher-order interior stencil changes the phase relation that the boundary operator needs to match.

There is a practical way to isolate this reflection in a pulse computation. Record incident and outgoing velocity or flux at the same interior sensor, and choose the duration so that the reflected signal arrives after the incident pulse has passed. Normalise amplitudes in the same physical variable, and avoid dividing a pressure peak by a displacement peak. A broadband pulse contains many values of the grid angle, so its returned waveform can change shape even when each monochromatic component obeys the calculated reflection coefficient.

Change parameters · Wave speeds and numerical dispersion

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.

Study the full derivation

How much of an outgoing wave reflects from the numerical boundary? · Spatial discretisation and field equations

A finite grid truncates an effectively open medium. Derive an exact one-dimensional radiation condition, predict the angular reflection of its two-dimensional extension and design a pulse experiment that separates boundary reflection from interior dispersion.