100% found this document useful (3 votes)
4K views

The Thomas Algorithm For Tridiagonal Matrix Equations PDF

The document describes the Thomas algorithm for solving tridiagonal systems of linear equations. The algorithm uses Gaussian elimination to sequentially solve for each unknown variable starting from the last equation down to the first. It requires fewer calculations than general Gaussian elimination since the matrix is tridiagonal. An example problem is provided and solved step-by-step using the Thomas algorithm.

Uploaded by

Andra Walileuw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
4K views

The Thomas Algorithm For Tridiagonal Matrix Equations PDF

The document describes the Thomas algorithm for solving tridiagonal systems of linear equations. The algorithm uses Gaussian elimination to sequentially solve for each unknown variable starting from the last equation down to the first. It requires fewer calculations than general Gaussian elimination since the matrix is tridiagonal. An example problem is provided and solved step-by-step using the Thomas algorithm.

Uploaded by

Andra Walileuw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

6-5

Chapter 6

Boundary-Value Problems

6.2 The Thomas Algorithm for Tridiagonal Matrix Equations

Consider the following tridiagonal system of equations


(
(
(
(
(
(
(


n n
n n n
b a
c b a
c b a
c b a
c b
0 0
0 0
0 0
0 0
0 0
1 1 1
3 3 3
2 2 2
1 1


(
(
(
(
(
(
(

n
n
y
y
y
y
y
1
3
2
1

=
(
(
(
(
(
(
(

n
n
r
r
r
r
r
1
3
2
1



where a
i
, b
i
, and c
i
represent the coefficients of y
i-1
, y
i
(the diagonal element), and y
i+1
,
respectively, in the ith equation. Using Gaussian elimination, y
1
can be eliminated from the
system by using the first equation to eliminate y
1
from the second equation. Likewise, the
second equation can be used to eliminate from y
2
the third equation. The process can be
repeated until the nth equation where the elimination of y
n-1
will provide the answer for y
n

since there are only two unknowns y
n-1
and y
n
in this equation. Back substitution to the (n-
1)th equation provides the answer for y
n-1
. In this manner, the solution for y
i
can be obtained
from knowing y
i+1
. The application of Gaussian elimination to a set of linear equations with a
tridiagonal coefficient matrix requires significantly fewer calculations than its application to
a general set of linear equations. This procedure is known as the Thomas algorithm with the
following results:

|
1
= b
1



1
= r
1
/|
1


For i = 2, ., n

|
i
= b
i
(a
i
c
i-1
/|
i-1
)


i
= (r
i
a
i

i-1
)/|
i


y
n
=
n


For j = 1, ., n1

y
n-j
=
n-j
c
n-j
y
n-j+1
/|
n-j


End
6-6
Example 6.2-1 _____________________________________________________

Solve the following set of linear equations
1



(
(
(
(

1 2 0 0
1 1 4 0
0 1 2 1
0 0 3 2
(
(
(
(

4
3
2
1
y
y
y
y
=
(
(
(
(

2
9
2
4


Solution

The values of a
i
, b
i
, c
i
, and r
i
are given as

i a
i
b
i
c
i
r
i

1
2
3
4
0
1
4
2
2
2
-1
-1
-3
-1
1
0
-4
2
9
2

It should be noted that the values of a
1
and c
4
never needed in the calculation. Therefore they
can be assigned any value without affecting the solution. For the elimination steps, we apply
the formula

|
1
= b
1



1
= r
1
/|
1


For i = 2, ., n

|
i
= b
i
(a
i
c
i-1
/|
i-1
)


i
= (r
i
a
i

i-1
)/|
i


|
1
= b
1
= 2


1
= r
1
/|
1
= 4/2

= 2

|
2
= b
2
(a
2
c
1
/|
1
) = 2 1(3)/2 = 3.5


2
= (r
2
a
2

1
)/|
2
= [2 1(2)]/3.5 = 1.14

|
3
= b
3
(a
3
c
2
/|
2
) = 1 4(1)/3.5 = 0.143


3
= (r
3
a
3

2
)/|
3
= [9 4(1.14)]/0.143 = 31

1
Riggs, J. B. An Introduction to Numerical Methods for Chemical Engineers, Texas Tech University Press,
1994, p. 39
6-7


|
4
= b
4
(a
4
c
3
/|
3
) = 1 2(1)/0.143 = 15


4
= (r
4
a
4

3
)/|
4
= [2 2(31)]/(15) = 4

For the back substitution steps, we apply the formula

y
n
=
n


For j = 1, ., n1

y
n-j
=
n-j
c
n-j
y
n-j+1
/|
n-j


y
4
=
4
= 4

y
3
= (
3
c
3
y
4
)/|
3
= [31 1(4)]/0.143 = 3

y
2
= (
2
c
2
y
3
)/|
2
= [1.14 (1)(3)]/3.5 = 2

y
1
= (
1
c
1
y
2
)/|
1
= [2 (3)(2)]/2 = 1

You might also like