Skip to content
All library documents

Solving Tridiagonal Systems with the Thomas Algorithm

Article QuantStart

Summary

This tutorial explains the Thomas algorithm, also called the tridiagonal matrix algorithm, for solving the banded linear systems produced by an implicit finite-difference method. It frames the algorithm as Gaussian elimination adapted to a matrix with nonzero entries only on its main diagonal and adjacent diagonals. The procedure first computes modified upper-diagonal and right-hand-side coefficients in a forward pass, then recovers the unknown grid values by back substitution.

The method is intended for repeated use at each time step in an implicit solver, where the system determines interior grid points. Such a solve costs more per step than an explicit update, while implicit methods can use larger time steps. The article gives the coefficient recurrences and reverse solve but does not discuss implementation details, numerical conditioning, or a worked example. Its immediate application is the finite-difference heat-equation series; the technique applies to suitable tridiagonal systems more generally.

Key ideas

  • The Thomas algorithm applies Gaussian elimination to tridiagonal linear systems.
  • A forward pass computes modified coefficients from the matrix diagonals and right-hand side.
  • Back substitution recovers the unknown values from the final grid point toward the first.
  • Implicit finite-difference schemes require solving such a system at each time step.
  • The article outlines the method but leaves implementation details for a later tutorial.

Tags

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