The Thomas algorithm is a direct method dedicated to solving tridiagonal systems of equations. When difference equations are set up along a line (a one-dimensional problem), the equation for each block involves only the unknowns of that block and of the blocks on either side, so the coefficient matrix is tridiagonal. The algorithm is a special case of Crout factorization; it only needs the coefficients on the three diagonals and the right-hand side stored as four vectors, rather than the whole matrix. Forward elimination comes first: w1 = c1/b1, g1 = d1/b1, followed successively by
Thomas algorithm
wi = ci/(bi − aiwi−1), gi = (di − aigi−1)/(bi − aiwi−1)
Back substitution then gives xn = gn, xi = gi − wixi+1 (i = n−1, …, 1). Here ai, bi, and ci are the coefficients of the unknowns of blocks i−1, i, and i+1 in the i-th equation, and di is the right-hand side.
The algorithm is computationally simple and requires little storage; wherever a tridiagonal system arises, in direct and iterative methods alike, it is solved with this algorithm, for example each line in line relaxation and each one-dimensional problem split off by the alternating direction implicit procedure.
References
- Zhang Liehui. Fundamentals of Oil and Gas Reservoir Numerical Simulation (in Chinese). Petroleum Industry Press, 2005.
- Han Dakuang; Chen Qinlei; Yan Cunzhang. Fundamentals of Reservoir Numerical Simulation (in Chinese). Petroleum Industry Press, 1993.