Professional Documents
Culture Documents
n4 Handout
n4 Handout
n4 Handout
Numerical Methods 4
The BTDMA is a matrix version of the TDMA, and therefore many of the details of its algorithm are
very similar to the TDMA. On the other hand, it is more complicated to encode and therefore I shall be
providing the appropriate subroutines for any assignments in which it is to be used.
B1 C1 Y1 R1
A2 B2 C2 Y2 R2
A3 B3 C3 Y3 R3
.. .. .. .. = .. .
. . .
.
.
AM −1 BM −1 CM −1 Y
M −1
R
M −1
AM BM YM RM
where A, B, and C now represent square matrices ( — 3×3 matrices for the problem we are considering),
and both Y and R are column vectors ( — 3×1 matrices).
The first step is to reduce the matrix to block bidiagonal form by eliminating the subdiagonal blocks.
The A2 block is removed in two stages: first premultiply the row 1 by B1−1 and then subtract A2 × row 1
from the row 2. The first stage yields the system,
I C1∗ Y1 R1∗
A2 B2 C2 Y2 R2
A3 B3 C3 Y3 R3
.. .. .. .. = .. ,
. . .
.
.
AM −1 BM −1 CM −1 Y
M −1
R
M −1
AM BM YM RM
here the matrices given in brackets are 3×4 (3 rows and 4 columns) for our example problem. The matrix
C1∗ and vector R1∗ are now obtained using a standard Gaussian elimination subroutine — this is generally
more efficient than computing B1−1 explicitly and then premultiplying C1 and R1 .
Now we can remove the A2 block by subtracting A2 × row 1 from row 2. Hence we obtain
I C1∗ Y1 R1∗
0 B2∗ C2 Y2 R2∗
A3 B3 C3 Y3 R3
.. .. .. .. = .. ,
. . .
.
.
AM −1 BM −1 CM −1 Y
M −1
R
M −1
AM BM YM RM
where B2∗ = B2 − A∗2 C1∗ and R2∗ = R2 − A∗2 R1∗ . Again, this form can be expressed using augmented matrix
notation:
(B2∗ |R2∗ ) = (B2 |R2 ) − A∗2 (C1∗ |R1∗ )
1
University of Bath, School of Mechanical Engineering T7 C.F.D. Numerical Methods 4
The two–stage elimination process is now used to remove the A3 block. We get
I C1∗ Y1 R1∗
0 I C2∗
Y2 R2 ∗∗
0 B3 C3
∗
Y3 R3∗
A4 B4 C4 Y4 = R4 ,
.. .. .. . .
. . . . .
. .
AM −1 BM −1 CM −1 YM −1 RM −1
AM BM YM RM
where B2 C2 = C2 , B2 R2 = R2 , B3 = B3 − A3 C2 and R3 = R3 − A3 R2 . In augmented matrix notation
∗ ∗ ∗ ∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗∗
The process of block subdiagonal elimination is continued until we obtain the block bidiagonal set of
equations,
I C1 Y1 R1
I C2 Y2 R2
I C3 Y3 R3
.. . .. = .. ,
. .. . .
I CM −1 YM −1 RM −1
BM YM RM
where the superscript asterisks have been omitted.
2. Solution by back–substitution.
The values of Yi (i = 1, M ) are now computed by back–substitution. The last matrix row is equivalent to
the equation,
B M Y M = RM ,
which is solved using the Gaussian Elimination subroutine.
As for the TDMA development, we shall write the above algorithm in as compact a form as is possible.
Hence we obtain the following algorithm:
For i=2,M:
solve Bi × (Ci |Ri )new = (Ci |Ri )old
compute (Bi |Ri )new = (Bi |Ri )old − A∗i (Ci−1 |Ri−1 )
Solve: BM YM = RM to obtain YM
For i=M-1,1 solve:
Bi Yi = (Ri − Ci Yi+1 ) to obtain Yi