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:
- math>
a_i x_{i - 1} + b_i x_i + c_i x_{i + 1} = d_i
</math>
Where and
Algorithm
- for k:= 2 step until n do
-