Unit 3.2
PDE Simulation
Explicit schemes, stability restrictions, and a full case study from formulation to interpretation.
- Unit 3.1
- Unit 3.2
§ Overview
Unit 3.1 produced the finite-difference stencils. This unit combines them into complete numerical schemes and examines their behaviour. The central example is the explicit forward-time central-space (FTCS) scheme for the heat equation, which is the simplest PDE solver and the foundation for understanding more advanced methods.
The unit's key theoretical content is the stability restriction on the
time step. For the explicit heat equation, the restriction takes the
form Δt ≤ Δx² / (2α). Understanding where it comes from,
and why it cannot be avoided within an explicit framework, is essential
for any serious PDE simulation.
The unit closes with a full case study — a wave or diffusion problem chosen to demonstrate the complete workflow from problem statement to interpretation.
Lesson 1
Explicit heat-equation schemes
Lesson 2
Stability and the time-step restriction
Lesson 3
Wave or diffusion case study
Laboratory 6
PDE simulation
§ Learning outcomes
By the end of Unit 3.2 you will be able to
- Implement the FTCS scheme for the one-dimensional heat equation.
- Apply the stability restriction
Δt ≤ Δx² / (2α)and explain its origin. - Demonstrate the consequences of violating the stability restriction.
- Verify a PDE simulation against an analytical solution for a tractable case.
- Interpret a PDE simulation result and identify the dominant error source.
§ Lessons
Explicit heat-equation schemes
Implement the FTCS scheme and read its output correctly. The simplest PDE solver, and the foundation for the rest of the module.
Lesson 2Stability and the time-step restriction
The CFL-type condition Δt ≤ Δx² / (2α), and what
happens when it is violated.
Wave or diffusion case study
A full worked simulation from formulation to interpretation, with error analysis and verification.
§ The FTCS scheme
Consider the one-dimensional heat equation
∂u/∂t = α ∂²u/∂x²
on a uniform grid with spacings Δx and Δt.
Using a forward difference in time and a central second difference in
space:
(u_i^{n+1} − u_i^n) / Δt = α (u_{i+1}^n − 2 u_i^n + u_{i−1}^n) / Δx²
Solving for u_i^{n+1}:
u_i^{n+1} = u_i^n + r ( u_{i+1}^n − 2 u_i^n + u_{i−1}^n )
where
r = α Δt / Δx²
is the diffusion number. The scheme is explicit: the new value at each grid point depends only on values at the previous time level, so it can be computed directly without solving a system.
n+1 is computed from three values at
time level n: the point itself and its two spatial
neighbours.
Explicit vs. implicit
The FTCS scheme is explicit: the new value at each point is computed directly. An implicit scheme would express the new value in terms of neighbouring values at the same time level, producing a system of equations that must be solved at each step. Explicit schemes are simpler to implement but subject to stability restrictions. Implicit schemes are more complex but unconditionally stable for the heat equation.
§ The CFL condition
The FTCS scheme is conditionally stable. The condition is
r = α Δt / Δx² ≤ 1/2
equivalently,
Δt ≤ Δx² / (2α)
This is the CFL condition for the explicit heat equation. It states that the time step must be smaller than the square of the spatial step divided by twice the diffusivity.
Three consequences are worth noting:
-
The restriction is quadratic in
Δx. Halving the spatial grid spacing requires quartering the time step. The total number of grid operations therefore scales as1/Δx³, which is why explicit methods are expensive for fine spatial grids. - The restriction is a property of the scheme, not of the problem. A different scheme — for example, an implicit one — has no such restriction. The CFL condition is a symptom of the explicit formulation.
- The restriction is not a matter of accuracy. Violating it produces a numerical solution that grows without bound, regardless of how accurate the initial condition is. The failure is catastrophic, not gradual.
Violating the CFL condition
When r > 1/2, the numerical solution develops
growing oscillations. The pattern is recognisable: alternating
positive and negative values that grow in magnitude with each time
step. Reducing the time step back below the CFL limit immediately
restores stability.
§ Key terms
- Forward-time central-space (FTCS)
- The explicit finite-difference scheme obtained by combining a forward difference in time with a central second difference in space. The simplest numerical scheme for the heat equation.
- Diffusion number
-
The dimensionless quantity
r = α Δt / Δx². It determines the stability and the accuracy of the FTCS scheme. - CFL condition
-
A stability restriction of the form
r ≤ 1/2for the explicit heat equation. Named for Courant, Friedrichs, and Lewy, who derived analogous conditions for hyperbolic problems. - Stability
- A property of a numerical scheme applied to a particular problem: small perturbations in the data do not grow without bound as the integration proceeds.
- Consistency
- A property of a numerical scheme: as the grid spacings tend to zero, the truncation error tends to zero. Both FTCS and implicit schemes for the heat equation are consistent.
- Convergence
- The property that the numerical solution tends to the exact solution as the grid spacings tend to zero. By the Lax equivalence theorem, for a consistent scheme, convergence is equivalent to stability.
§ Self-check
Check your understanding
Question 1
In the FTCS scheme for the heat equation, the diffusion number
r is defined as:
Show answer
α Δt / Δx². The diffusion number
is dimensionless, as required for a stability condition. The
combination α Δt / Δx² is the only product of the
problem and scheme parameters that has no units.
Question 2
The CFL condition for the explicit heat equation is:
Show answer
r ≤ 1/2. The condition is derived
from a von Neumann stability analysis of the FTCS scheme.
Violating it produces a numerical solution that grows without
bound.
Question 3
Halving the spatial grid spacing in the FTCS scheme requires:
Show answer
Quartering the time step. The CFL condition
Δt ≤ Δx² / (2α) is quadratic in the spatial step.
Halving Δx reduces Δx² by a factor of
4, so the time step must be reduced by the same factor. The
total number of operations scales as 1/Δx³.