2025-05-12 08:31:36
This post is part of a series of articles on the Finite Difference Method, with other posts in this series covering:
In the previous article, a set of linear equations was arranged in the form of a tridiagonal matrix equation. Solving this equation allows for the calculation of values at the interior grid points. The system of equations must be solved at every time step, which clearly requires more resources than the explicit method at each time step. However, the implicit method can use much larger time steps, giving it a long-term advantage.
The method used to solve this matrix equation is Llewellyn Thomas's algorithm, also known as the Tridiagonal Matrix Algorithm (TDMA), which is essentially the application of Gaussian Elimination to a matrix with a banded structure.
The initial equation can be written in the form:
aiui−1n+1+biuin+1+ciui+1n+1=di
For i=1,2,...,N−2
The algorithm starts by creating new coefficients ci′ and di′ to replace ai, bi, ci, and di as follows:
For i=1:
c1′=b1c1,d1′=b1d1
For i=2,3,...,N−2:
ci′=bi−aici−1′ci
di′=bi−aici−1′di−aidi−1′
With these new coefficients The system of equations can be rewritten in the form:
uin+1=ci′ui+1n+1+di′, for i=1,2,...,N−2
When the values of ci′ and di′ have been fully calculated, the value of uin+1 can be found by back-substituting from i=N−2 down to i=1 as follows:
Starting point:
uN−2n+1=dN−2′
Backtrack:
uin+1=ci′ui+1n+1+di′, for i=N−3,...,1
At this stage, the algorithm for finding the values at each grid point at each time step has been fully described. The final step in practical implementation is to write a program to process according to the algorithm, which will be the topic of the next article.
Reference: Tridiagonal Matrix Solver via Thomas Algorithm
From https://www.quantstart.com/articles/Tridiagonal-Matrix-Solver-via-Thomas-Algorithm/
2025-01-10 10:12:01
2024-05-31 03:06:49
2024-05-28 03:09:25
There are many other interesting articles, try selecting them from below.
2024-03-15 01:05:30
2024-03-08 04:03:12
2023-11-07 11:39:12
2024-12-12 05:31:25
2024-03-15 09:32:17
2024-12-03 04:32:17
2023-11-10 10:24:39