Tridiagonal matrix algorithm - TDMA (Thomas algorithm)
From CFD-Wiki
Introduction
The Thomas Algorithm is a special form of Gauss elimination that can be used to solve tridiagonal systems of equations. When the matrix is tridiagonal, the solution can be obtained in O(n) operations, instead of O(n3/3). Example of such matrices are matrices arising from descretisation of 1D problems.
We can write the tri-diagonal system in the form:
Where and
Algorithm
- for k:= 2 step until n do
-
- end loop (k)
- then
-
- for k := n-1 stepdown until 1 do
-
- end loop (k)
References
- Conte, S.D., and deBoor, C. (1972), Elementary Numerical Analysis, McGraw-Hill, New York..