Stability and the CFL Condition

Part 4, The Acoustic Wave Equation

Learning objectives

  • Say what the Courant number counts: the grid cells a wave crosses in one time step
  • State the stability limits of the book's two schemes, 0.707 for the second-order Laplacian and 0.612 for the fourth-order one, and where they come from
  • Watch a run stay bounded just below its limit and blow up just past it, and read the growth per step from the engine and from Fourier analysis
  • Say why the CFL condition is necessary but not sufficient, and what the limit costs in time steps

A Hard Speed Limit

Marching the wave equation forward with an explicit stencil is fast, but it comes with a rule that cannot be bargained with. Each new wavefield is built from the ones before it, and if the time step is too long for the grid the scheme does not merely lose accuracy: it becomes unstable, and an error too small to see is multiplied at every step until it is the whole answer. The controlling quantity is the Courant number

C=V Δth,C = \dfrac{V\,\Delta t}{h},

the number of grid cells a wave crosses in one time step. Every scheme has a largest Courant number it can take, set by its stencil, and this section finds the two the book uses: 1/2=0.7071/\sqrt{2} = 0.707 for the second-order Laplacian of Section 4.2 and 3/8=0.612\sqrt{3/8} = 0.612 for the fourth-order one, the values of the engine's own stability limits.

The figure runs that engine in a uniform medium of the standard shale, 2.80 km/s, on the standard 5 m cells: a 30 Hz Ricker at the centre of a 60 by 60 box with rigid walls. You choose the Laplacian and the Courant number, and the time step follows as Δt=Ch/V\Delta t = C h / V. Plate (a) is the wavefield after the number of steps you choose, (b) is the largest value on the grid at every step, (c) is the growth per step, from von Neumann's analysis and from the engine, and (d) is what the stencil can reach.

The fourth-order scheme at a Courant number of 0.62, 1.012 times its limit of 0.612:the peak passes 10 at step 55 and by step 160 it is a power of ten of 15.0; Fourieranalysis predicts 1.371 a step and the engine measures 1.361.(a) The wavefield after 60 steps01002003000100200300Distance (m)(b) The largest amplitude040801201600102030StepPower of ten(c) Growth per step0.550.600.650.700.750.801.01.52.02.53.0Courant number(d) After 3 steps-6-3036-6-3036Cells across(b) dashed: a peak of 10, above which the run is blown(c) dark: fourth order; teal: second order; dots: the engine(c), (d) red: the run you setFourth-order scheme at a Courant number of 0.62, 1.012 times its limit (C = 0.62 against 0.612(SSMWave.courantLimit 4)). The peak first passes 10 at step 55. Growth per step: von Neumann 1.371, theengine 1.361. Limit from the weights 0.612. Power of ten of the peak after 60 steps: 1.8.

Just Below the Limit, Just Past It

Choose the fourth-order scheme and set 0.61. The limit is 0.612, so this is 0.996 of it, a time step of 1.09 ms, and in all 160 steps the largest value on the grid never passes 0.47, the size of the pulse itself. Now set 0.62: a time step 1.6 percent longer, 1.012 times the limit. The peak passes 10 at step 55 and by step 160 it is a power of ten of 15. Nothing in the physics changed. What took over is a checkerboard, a wave of two cells' wavelength across and down, the shortest the grid can hold, and the scheme amplifies it by the same factor at every step: 1.371 by Fourier analysis, 1.361 as the engine measures it. It needs no cause. The pulse and the arithmetic's rounding error both put a little of every wave the grid can hold into the field, and one of them is amplified.

The second-order scheme does the same around its own limit. At 0.70 the run stays bounded; at 0.71, 1.004 times its limit, the peak passes 10 at step 95, later than the fourth-order run because its growth factor is smaller, 1.198 a step against 1.371. There is no gentle degradation between the two: the growth begins as a square root of the excess, so a Courant number only 1 percent over either limit already amplifies the checkerboard 1.33 times a step.

Where the Limits Come From

Von Neumann's idea needs no simulation. Take a plane wave on the grid, step it once with the scheme, and ask by what factor GG its amplitude has changed. If ∣G∣=1|G| = 1 for every wave the grid can hold, nothing grows; if some wave has ∣G∣>1|G| > 1 it grows by that factor every step. For the leapfrog scheme the factor solves G2−aG+1=0G^2 - aG + 1 = 0 with a=2+C2λa = 2 + C^2 \lambda, where λ\lambda is the stencil's second difference of that wave, and the two roots multiply to 1, so they have modulus 1 exactly while ∣a∣≤2|a| \le 2. The worst wave is the checkerboard, where the stencil's weights, which alternate in sign, all add: λ=−2S\lambda = -2S, with SS the sum of their absolute values in one dimension. Stability is then

C≤2S.C \le \sqrt{\dfrac{2}{S}}.

For the second-order stencil S=4S = 4, for the fourth-order one S=16/3S = 16/3, and the limits are 1/21/\sqrt{2} and 3/8\sqrt{3/8}, the recipe of Lines, Slawinski and Bording (1998), which finds the limit from the sum of the stencil's weights. The wider stencil is the more accurate and the less stable: it needs a time step shorter by 3/4=0.866\sqrt{3/4} = 0.866, which is 15 percent more steps for the same run.

The figure checks this two ways at once. Fourier analysis, which never runs the engine, reads 1.819 a step at 0.64; the engine, measured over its last 20 steps before it stops, gives 1.806. Across the ten engine runs of plate (c), at 1.01 to 1.12 times each limit, the engine is always a little under the analysis, by at most 1.3 percent, because it approaches the theory from below as the checkerboard takes over from the pulse.

Necessary, Not Sufficient

Courant, Friedrichs and Lewy (1928) found the condition that carries their names, and it asks something simpler. A value at a point is computed from the cells inside the stencil, so after nn steps the cells that can have influenced it lie in a diamond ∣i∣+∣j∣≤rn|i| + |j| \le rn, where rr is the stencil's reach in cells, 1 for the second-order stencil and 2 for the fourth-order one. The second-order stencil fills its diamond; the fourth-order stencil reaches the tips and most of the cells between. The physical wave has reached the disc of radius CnCn cells. A scheme that has not heard from the cells the wave came from cannot converge, so the disc must lie inside the diamond, and the largest disc that does requires C≤r/2C \le r/\sqrt{2}: 0.707 for the second-order stencil, 1.414 for the fourth-order one (plate d). The first is the stability limit exactly. The second is more than twice as lax as the limit of 0.612, so the CFL condition is necessary, not sufficient: the reach decides whether a scheme can work at all, and the weights decide how large a step it can take.

What the Limit Costs

The limit sets the time step, Δt≤Cmax⁡h/Vmax⁡\Delta t \le C_{\max} h / V_{\max}, and in a model with a varying velocity the fastest cell sets it for the whole run. Faster rock forces a smaller step, and so does a finer grid: halve the cell and the step halves with it, so a 2D run costs about eight times as much, four times the cells and twice the steps. A 4.5 km/s salt body in the 2.80 km/s shale needs a step of 0.68 ms on 5 m cells with the fourth-order scheme, against 1.09 ms for the shale alone.

The book's own runs sit well inside the limit, at a Courant number of 0.25, 41 percent of the fourth-order limit. Stability buys a bounded answer, not an accurate one: a run under the limit still carries its short waves at the wrong speed, which is numerical dispersion, the subject of the next section.

References

  • Charney, J. G., Fjørtoft, R., & von Neumann, J. (1950). Numerical integration of the barotropic vorticity equation. Tellus, 2(4), 237–254.
  • Courant, R., Friedrichs, K., & Lewy, H. (1928). Über die partiellen Differenzengleichungen der mathematischen Physik. Mathematische Annalen, 100, 32–74. English translation: On the partial difference equations of mathematical physics, IBM Journal of Research and Development, 11(2), 215–234 (1967).
  • Lines, L. R., Slawinski, R., & Bording, R. P. (1998). A recipe for stability analysis of finite-difference wave equation computations. CREWES Research Report, 10.

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.