MATH 4810Computational Modelling

Module 03 · Unit 3.1

Finite-Difference Foundations

Extend discretization from one dimension to grids in space and time. Derive the finite-difference approximations of derivatives, and establish the boundary and initial conditions that make a PDE problem well posed.

3 lessons ≈ 8 hours Laboratory 5 Feeds Assignment 3
  1. Unit 3.1
  2. 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.

§ 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.

Standard finite-difference approximations
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)
The three-point central-difference stencil A one-dimensional grid of evenly spaced points. The point u_i is marked at the centre. Its immediate left neighbour is u_{i-1} and its immediate right neighbour is u_{i+1}. Arrows from both neighbours converge on u_i, indicating that the second difference at u_i uses both neighbours. u_i u_{i−1} u_{i+1} u_i'' ≈ (u_{i+1} − 2u_i + u_{i−1}) / Δx²
Figure 3.1. The three-point central-difference stencil. The second derivative at a grid point uses its two immediate neighbours and its own value.

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.

Boundary condition types
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^n defined at every grid point. It is the discrete approximation to the continuous solution u(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.

👤