Skip to content
All library documents

Crank-Nicolson Finite Differences for the Heat Equation

Article QuantStart

Summary

This tutorial presents the Crank-Nicolson method for numerically solving the one-dimensional heat equation. It motivates the method by noting that an explicit finite-difference scheme can impose a restrictive time step. Crank-Nicolson averages the spatial second-derivative terms at the current and next time levels, using equal weighting in the version described. The tutorial also mentions a broader weighting parameter and its stated stability range.

Since next-step grid values are unknown, rearranging the scheme produces a tridiagonal linear system for the interior spatial points at each time step. Fixed Dirichlet boundary values are excluded from that solve. The article lays out the matrix coefficients and right-hand side, then cautions that directly inverting the matrix is inefficient because it ignores the matrix’s sparse banded structure. It points to the Thomas algorithm as a follow-up for efficient solution. The discussion focuses on the numerical method rather than a financial pricing application or a worked convergence example.

Key ideas

  • Crank-Nicolson averages spatial second derivatives from the current and next time levels.
  • The equal-weight scheme requires solving a tridiagonal system at every time step.
  • Fixed boundary points are specified separately from the interior grid-point solve.
  • Implicit stepping allows larger time steps than the restrictive explicit scheme described.
  • A direct matrix inverse ignores the system’s sparse, banded structure.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.