MTH3007b Lecture 9
Me, in the lecture
zzzzz…
This session recaps the FTCS scheme with a fuller implementation, analyses its stability, and introduces the implicit BTCS scheme as an unconditionally stable alternative. We also cover Neumann boundary conditions and how to incorporate them numerically.
FTCS Recap and Full Implementation
The FTCS scheme update is:
with . Here is the spatial index and is the time index.
The full implementation below uses physically motivated parameters (aluminium rod, fixed boundary temperatures):
FTCS Stability
Stability Argument
Look at the coefficient of in the FTCS update: it is . For the scheme to be non-amplifying, we need:
This gives . The full stability proof (see Hoffman 2001) tightens this result. The FTCS scheme is stable and convergent if and only if:
Equivalently, the time step must satisfy:
Warning
If , the FTCS solution will grow without bound and become meaningless. Always check before running.
Implicit Scheme: BTCS
BTCS (Backward-Time Centred-Space) uses a backward (implicit) difference in time:
Rearranging (with ):
The new unknowns appear on the left-hand side for all simultaneously, so we cannot update point by point. Instead, the equations form a tridiagonal linear system:
where is a tridiagonal matrix with on the diagonal and on the off-diagonals.
Solving the System
One option is standard Gaussian elimination. Another option is to invert once using numpy.linalg.inv and then apply at every time step - efficient when is fixed:
Note
The Thomas algorithm is a specialised solver for tridiagonal systems. It is mentioned here for completeness - we won’t discuss the algorithm in detail.
Unconditional Stability of BTCS
The BTCS scheme is unconditionally stable: there is no restriction on . The update factor at each interior node is , which is always less than 1 for any . Large time steps can therefore be used without the solution blowing up, which is a major practical advantage over FTCS.
Neumann Boundary Conditions
A Neumann BC specifies the gradient at the boundary rather than the value. At the left boundary, . To implement this numerically, we introduce a ghost point just outside the domain.
Using the centred difference approximation for the derivative at (see Boundary conditions):
For an insulating boundary (), this simplifies to:
Pre-Lecture Notes from University Notes
- FTCS update: , .
- Stability: coefficient of is ; require ; full proof (Hoffman 2001) gives .
- BTCS: backward time difference gives tridiagonal system ; solved by Gaussian elimination or matrix inversion.
- BTCS is unconditionally stable - the update factor for all .
- Thomas algorithm ( tridiagonal solver) exists but is not covered in this module.
- Neumann BC: ghost point ; insulation () gives .
- Next session: the 2D Laplace equation and Liebmann’s iterative method.