Interactive Educational Modules in
Scientific Computing

CFL Condition

This module illustrates the CFL condition for stability of an explicit finite difference discretization of the wave equation. The domain of dependence of a hyperbolic partial differential equation (PDE) for a given point in the problem domain is that portion of the problem domain that influences the value of the solution at the given point. Similarly, the domain of dependence of an explicit finite difference scheme for a given mesh point is the set of mesh points that affect the value of the approximate solution at the given mesh point. The CFL condition, named for its originators Courant, Friedrichs, and Lewy, requires that the domain of dependence of the PDE must lie within the domain of dependence of the finite difference scheme for each mesh point of an explicit finite difference scheme for a hyperbolic PDE. Any explicit finite difference scheme that violates the CFL condition is necessarily unstable, but satisfying the CFL condition does not necessarily guarantee stability. This module illustrates the CFL condition for the wave equation utt = c uxx, where the constant c determines the wave speed. For the wave equation, the domain of dependence for a given point is an isosceles triangle having its apex at the given point, one edge on the spatial axis, and remaining edges with slopes 1 ⁄ c½ and −1 ⁄ c½. The standard finite difference scheme for the wave equation uses centered, second-order accurate differences in both space and time (see Wave Equation module), whose stencil also yields a triangular-shaped domain of dependence as the numerical scheme marches forward in time.

The coefficient c, spatial step size Δx, and time step Δt can be selected using the sliders below, and the resulting domains of dependence for a typical mesh point are drawn in the graph of the problem domain, with the mesh points of the finite difference scheme shown as black dots, the domain of dependence of the PDE shaded red, the domain of dependence of the difference scheme shaded blue, and the overlap between the two domains of dependence shaded magenta. From the geometric relationships in the graph, it is clear that the CFL condition requires that c½Δt ⁄Δx ≤ 1. Accordingly, the word “stable” or “unstable” appears below the graph, depending on whether the CFL condition is satisfied or not, respectively. Note that for given choices of any two of the three parameters, the difference scheme can be stable or unstable, depending on the choice of the third parameter.

The CFL condition can be interpreted intuitively as requiring that the distance c½Δt traveled by a wave in one time step not exceed one spatial step Δx, or equivalently that the numerical wave speed Δx ⁄ Δt be at least as fast as the physical wave speed c½. In practice, the value of c is determined by the physical problem being solved, Δx is chosen to achieve the desired accuracy in the approximate solution, and the CFL condition then becomes a limit Δt ≤ Δxc½ on the time step Δt for the difference scheme to be stable.

Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 11.2.2, especially Example 11.4 and Figure 11.6.

Developers: Evan VanderZee and Michael Heath