Unit 3.1
Finite-Difference Foundations
Grids, derivative approximations, and the boundary and initial conditions that determine whether a PDE problem is well posed.
- Unit 3.1
- Unit 3.2
§ Overview
A partial differential equation describes how a quantity varies in space and time. Where Module 2 discretized the time axis alone, this unit discretizes both — producing a grid on which the derivatives are replaced by finite differences. The result is a stencil: a rule that expresses the value at a grid point in terms of its neighbours.
The unit begins with grids and the construction of finite-difference approximations, states their truncation error orders, and closes with the boundary and initial conditions that must accompany a PDE for the problem to be well posed. The stencils derived here are assembled into working schemes in Unit 3.2.
Lesson 1
Spatial and temporal grids
Lesson 2
Finite-difference derivative approximations
Lesson 3
Boundary and initial conditions
Laboratory 5
Finite-difference formulas
§ Learning outcomes
By the end of Unit 3.1 you will be able to
- Construct a uniform spatial grid and a uniform temporal grid for a PDE problem.
- Derive forward, backward, and central finite-difference approximations from Taylor expansions.
- State the truncation error order of each approximation.
- Combine one-dimensional differences into stencils for the Laplacian and the heat operator.
- Classify boundary conditions as Dirichlet, Neumann, or Robin.
- Determine whether a given PDE problem is well posed.
§ Lessons
The three lessons build cumulatively. Lesson 1 establishes the grid; Lesson 2 derives the difference approximations on that grid; Lesson 3 adds the conditions that make a PDE problem well posed.
Spatial and temporal grids
Choose and document the discretization that defines the numerical problem.
Lesson 2Finite-difference derivative approximations
Forward, backward, and central differences, and their truncation error orders.
Lesson 3Boundary and initial conditions
Dirichlet, Neumann, and Robin conditions, and the conditions under which a PDE problem is well posed.
§ Grids and difference formulas
A finite-difference method represents a continuous function on a
discrete set of points. For a problem in one space dimension and time,
the grid is characterised by two spacings: Δx in space and
Δt in time. The value of the solution at grid point
(x_i, t_n) is denoted u_i^n.
| Approximation | Formula | Order |
|---|---|---|
Forward difference in x |
(u_{i+1} − u_i) / Δx |
O(Δx) |
Backward difference in x |
(u_i − u_{i−1}) / Δx |
O(Δx) |
Central difference in x |
(u_{i+1} − u_{i−1}) / (2 Δx) |
O(Δx²) |
Second difference in x |
(u_{i+1} − 2 u_i + u_{i−1}) / Δx² |
O(Δx²) |
Forward difference in t |
(u^{n+1} − u^n) / Δt |
O(Δt) |
Stencils define the numerical problem
The finite-difference formula is not the PDE. The PDE is the continuous equation; the stencil is a discrete rule applied at each grid point. Two different stencils for the same PDE give two different numerical problems, with different accuracy and stability properties.
§ Well-posedness
A PDE alone does not define a well-posed problem. Three ingredients are required:
- A domain. The region of space and time over which the equation holds.
- A PDE. The equation itself, valid in the interior of the domain.
- Boundary and initial conditions. Values or derivatives specified on the boundary of the domain and, for time-dependent problems, at the initial time.
A problem is well posed if a solution exists, is unique, and depends continuously on the data. The third property — continuous dependence — is what makes numerical computation meaningful: if small changes in the boundary data produce large changes in the solution, no numerical method can produce reliable answers.
| Type | Condition | Physical interpretation |
|---|---|---|
| Dirichlet | u = g on the boundary |
The value of the quantity is fixed |
| Neumann | ∂u/∂n = g on the boundary |
The flux is fixed |
| Robin | a u + b ∂u/∂n = g on the boundary |
A combination of value and flux |
Well-posedness is a prerequisite
A numerical method applied to an ill-posed problem cannot produce a reliable solution. No amount of refinement of the grid will help. Verification of the numerical scheme is meaningless if the underlying problem is not well posed.
§ Key terms
- Grid spacing
-
The distance between consecutive grid points. In space, denoted
Δx; in time,Δt. - Grid function
-
The set of numerical values
u_i^ndefined at every grid point. It is the discrete approximation to the continuous solutionu(x, t). - Stencil
- The set of grid points used to approximate a derivative at a given point. A three-point stencil uses the point and its two neighbours.
- Truncation error
- The difference between the exact derivative and its finite-difference approximation, obtained from a Taylor expansion.
- Well posed
- A problem is well posed if it has a unique solution that depends continuously on the data. For PDE problems, this requires a domain, a PDE, and appropriate boundary and initial conditions.
- Domain of dependence
- The set of points in the initial and boundary data that influence the solution at a given point. For hyperbolic problems, this is a finite region; for parabolic problems, it is the entire domain.
§ Self-check
Check your understanding
Question 1
Which finite-difference approximation to the first derivative is second-order accurate?
Show answer
Central difference. The symmetric form
(u_{i+1} − u_{i−1}) / (2Δx) cancels the leading
error term, leaving O(Δx²). Forward and backward
differences are only first-order accurate.
Question 2
A PDE problem is well posed when it has:
Show answer
Existence, uniqueness, and continuous dependence on the data. The third condition is essential for numerical work: if small changes in the boundary data produce large changes in the solution, no numerical method can be relied upon.
Question 3
A boundary condition of the form ∂u/∂n = g is:
Show answer
Neumann. A Neumann condition specifies the derivative of the solution normal to the boundary — physically, the flux. A Dirichlet condition specifies the value itself. A Robin condition specifies a linear combination.