CFL Condition Explained with Worked Examples

For an explicit scheme for the wave equation with speed , grid spacing and time step , stability needs the Courant number .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

  • wave or advection equations u_t + c u_x = 0
  • grid spacing Δx and time step Δt
  • numerical stability

What CFL condition means

The idea is physical: in one time step information travels a distance , and the numerical scheme must reach at least that far. If exceeds , the true solution depends on points the scheme never looks at, so the scheme cannot be right. For , , , : stable. The largest step is , and gives : unstable. The wave itself is described in the wave equation and d'Alembert's solution.

For sound in air, m/s, a grid with m requires s. Halving forces halving , so the cost of a 3D simulation grows like the fourth power of the resolution. Compare the stricter condition for diffusion in the explicit heat scheme.

The same idea limits the stability of Euler's method, and the spatial differences are those of the central difference. Implicit methods such as Crank–Nicolson avoid the restriction.

What is it used for?

The condition links the time step to the grid size and wave speed so that a simulation stays stable.

How to use cfl condition

  1. Find the wave speed and the grid spacing .
  2. Compute the largest time step .
  3. Check that the chosen satisfies .
  4. Reduce if it does not.

Graph

Courant number ν = 2Δt/0.1 against the time step Δt0.04: stable0.06: unstable00.010.020.030.040.050.060.070.0800.20.40.60.811.21.41.6Courant number ν = 2Δt/0.1 against the time step ΔtΔtνν = cΔt/Δxstability limit ν = 1Graph with x from 0 to 0.08 and y from 0 to 1.7. Shows the curve ν = cΔt/Δx; the curve stability limit ν = 1; point 0.04: stable at (0.04, 0.8); point 0.06: unstable at (0.06, 1.2).

Time steps above 0.05 push the Courant number over 1.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: a stable step

Find for , , .

Worked example
Answer
0.8 (stable)0.8\ \text{(stable)}
  1. Formula

Example 2: an unstable step

Find for , , .

Worked example
Answer
1.2 (unstable)1.2\ \text{(unstable)}
  1. Formula

Example 3: sound in air

Find the largest for and .

Worked example
Answer
0.00147 s0.00147\ \text{s}
  1. Formula

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

Courant number

C = cΔt/Δx

c = 2, Δx = 0.1, Δt = 0.04 gives 0.8.

Stable

C ≤ 1

For explicit upwind schemes.

Unstable

Δt = 0.06 gives C = 1.2

Violates CFL.

Largest step

Δt ≤ Δx/c = 0.05

The CFL limit.

Word problems

The Courant–Friedrichs–Lewy condition requires the numerical domain of dependence to contain the true one: for u_t + c u_x = 0 with an explicit upwind scheme, the Courant number C = |c|Δt/Δx must satisfy C ≤ 1.

Courant number

c = 2, Δx = 0.1, Δt = 0.04. Find C.

  1. 2 × 0.04 ÷ 0.1
  2. Check: 0.8 ≤ 1 ✓0.8.

Largest step

Find the largest stable Δt.

  1. Δx ÷ c
  2. Check: ✓0.05.

Violation Higher

Δt = 0.06. Find C.

  1. 2 × 0.06 ÷ 0.1
  2. Check: 1.2 > 1, unstable ✓1.2.

Finer grid Higher

Halve Δx to 0.05. What is the new Δt limit?

  1. 0.05 ÷ 2
  2. Check: 0.025 ✓0.025.

Common mistakes

Ignoring c

Δt ≤ Δx ✗

Δt ≤ Δx/c ✓

Speed matters.

Assuming CFL guarantees accuracy

stable means accurate ✗

necessary for stability only ✓

It does not ensure accuracy.

Using absolute spacing in time

Δx units ✗

consistent units ✓

Match units.

Thinking larger C is better

C > 1 faster ✗

C > 1 diverges for explicit schemes ✓

Violates CFL.

Exam tips

  1. C = cΔt/Δx ≤ 1.
  2. Halve Δx: halve Δt.
  3. Necessary condition.
  4. Units consistent.
  5. Implicit schemes avoid it.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. C for c = 1, Δx = 0.2, Δt = 0.1 Foundation

0.5

2. Largest Δt for c = 4, Δx = 0.2 Foundation

0.05

3. C for c = 3, Δx = 0.1, Δt = 0.05 Foundation

1.5

4. Largest Δt for c = 0.5, Δx = 0.01 Higher

0.02

5. C for c = 2, Δx = 0.5, Δt = 0.25 Higher

1

6. New limit when Δx = 0.05 and c = 1 Higher

0.05

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

CFL condition
Stability condition on Δt/Δx.
Courant number
cΔt/Δx.
Domain of dependence
Region influencing a point.
Upwind scheme
Difference against the flow.
Explicit scheme
Uses known values.
Advection
Transport at speed c.

Frequently asked questions

What is the CFL condition?

The Courant number must be at most 1.

What is the Courant number?

cΔt/Δx.

What if C > 1?

The explicit scheme is unstable.

What happens when Δx halves?

Δt must halve too.

Which page covers the heat scheme?

explicit heat scheme stability.

Which page covers Euler stability?

Euler method stability.

More in Numerical methods and optimisation and the formula sheets.