Beruflich Dokumente
Kultur Dokumente
Special Matrices
SPECIAL MATRICES
Banded Matrix:
A banded matrix is a square matrix that has all elements equal to zero,
with the exception of a band centered on the main diagonal.
b)
SPECIAL MATRICES
The dimensions of a banded system can be quantified by two
parameters:
a)
b)
0 0
BW
0
HBW
0 0
HBW + 1
TRIDIAGONAL SYSTEM
A banded matrix with a bandwidth of 3 is called a tridiagonal
system. It can be expressed generally as
f1
e2
g1
f2
e3
g2
f3 g3
en 1
f n 1
en
x1 r1
x
2 r2
x r
3 3
g n 1 xn 1 rn 1
f n xn rn
TRIDIAGONAL SYSTEM
By LU decomposition, the tridiagonal system is transformed to
f1 g1
e2 f 2
e3
1
~
e2 1
e~2
g2
f3
g3
en 1 f n 1 g n 1
en
f n
f1 g1
~
f2
e~n 1 1
e~n 1
g2
~
f3
g3
~
f n 1
g n 1
~
fn
THOMAS ALGORITHM
A tridiagonal system can be solved efficiently by using Thomas
algorithm. The algorithm consists of three steps:
1. Decomposition:
e
e~k k
f k 1
where k = 2,3,.,n
~
f k f k e~k g k 1
THOMAS ALGORITHM
2. Forward Substitution:
~
rk rk e~k rk 1
where k = 2,3,.,n
3. Back Substitution:
~
r
xn ~n
fn
~
r g x
xk k ~k k 1
fk
where k = n-1,n-2,..,2,1
EXAMPLE 1
Solve the following tridiagonal system:
0
0 x1 40.8
2.04 1
1
2
.
04
1
0
0
.
8
1 2.04 1 x3
0.8
0
1 2.04 x4 200.8
SOLUTION
LU decomposition
0
0
2.04 1
0
1 2.04 1
0
1 2.04 1
1
2
.
04
0
0
2.04 1
0
1
.
550
1
0
0
1 2.04 1
1
2
.
04
0
0
2.04 1
0
1
.
550
1
0
0
0
1.395 1
0
0
1 2.04
0
0
2.04 1
0
1
.
550
1
0
0
0
1.395 1
0
0
0
1.323
R2 ( 2.041 ) R1
1
R3 ( 1.550
) R2
1
R4 ( 1.395
) R3
SOLUTION
The factors employed to obtain the upper triangular matrix are
~
f 2 2.041 0.49
~
1
f 3 1.550
0.645
~
1
f 4 1.395
0.717
LU decomposition
0
0
1
1
0
0.49
[ A] [ L][U ]
0
0.645
1
0
0
0.717
0 2.04 1
0
0
0 0 1.550 1
0
0 0
0
1.395 1
1 0
0
0
1.323
SOLUTION
Forward decomposition
r2 0.8 (0.49)(40.8) 20.8
r3 0.8 (0.645)(20.8) 14.221
r4 200.8 (0.717)(14.221) 210.996
14.221
210.996
SOLUTION
Back decomposition
x4
r4
f4
x3
r3 g 3 T4
f3
1)(159.480 )
14.221(1.395
124.538
x2
r2 g 2 T3
f2
x1
r1 g1 T2
f1
210.996
1.323
159.480
20. ( 1)(124.538)
1.550
93.778
40.8 ( 1)(93.778)
2.04
65.970
EXAMPLE 2
a) Solve the following tridiagonal system with the Thomas algorithm
0 x1 41
0.8 0.4
0
.
4
0
.
8
0
.
4
x
25
SOLUTION
a)
0 x1 41
0.8 0.4
We have
f1 0.8,
g1 0.4,
e2 0.4, f 2 0.8,
r1 41
g 2 0.4,
e3 0.4, f 3 0.8,
r2 25
r3 105
Decomposition:
For k = 2,
e
0.4
e~2 2
0.5
f1
0.8
~
f 2 f 2 e~2 g1 0.8 (0.5)(0.4) 0.6
SOLUTION
For k = 3,
e
0.4
e~3 ~3
0.66667
0
.
6
f2
~
f 3 f 3 e~3 g 2 0.8 (0.66667)(0.4) 0.53333
[ A] [ L][U ] 0.5
1
0 0
0.6
0.4
0
0.66667 1 0
0
0.53333
SOLUTION
0
0 0.8 0.4
0
1
[ A] [ L][U ] 0.5
1
0 0
0.6
0.4
0
0.66667 1 0
0
0.53333
Forward substitution:
For k = 2,
For k = 3,
~
r2 r2 e2 r1 25 (0.5)(41) 45.5
~
r3 r3 e3 ~
r2 105 (0.66667)(45.5) 135.3333
41
45.5
135.3333
SOLUTION
0
0 0.8 0.4
0
1
[ A] [ L][U ] 0.5
1
0 0
0.6
0.4
0
0.66667 1 0
0
0.53333
Back substitution:
For k = 3,
x3
r3 135.3333
253.75
f 3 0.53333
For k = 2,
x2
r2 g 2 x3 [45.5 (0.4)(253.75)]
245
f2
0.6
For k = 1,
x1
r1 g1 x2 [41 (0.4)(245)]
173.75
f1
0.8
x2 245,
x3 253.75
SOLUTION
b) The LU decomposition is
0
0
1
[ L] 0.5
1
0 ,
0
0.66667 1
0
0.8 0.4
[U ] 0
0.6
0.4
0
0
0.53333
d1
where {D} d 2
d
3
0
0 d1 1
1
0.5
1
0 d 2 0
0
0.66667 1 d 3 0
d1 1
0.5d1 d 2 0
0.66667 d 2 d 3 0
d1 1,
d 2 0.5,
d 3 0.333335
SOLUTION
And
[U ]{ A1} {D}
0 A11
1
0 .8 0 .4
0
0 .6
0.4 A21 0.5
0
0
0.53333 A31 0.333335
A31 0.625,
The first column of the inverse is
A21 1.25,
1.875
1.25
0.625
A11 1.875
SOLUTION
For the second column,
0
[ L]{D} 1 ,
0
d1
where {D} d 2
d
3
0
0 d1 0
1
0.5
1
0 d 2 1
0
0.66667 1 d 3 0
d1 0
0.5d1 d 2 1
0.66667 d 2 d 3 0
d1 0,
d 2 1,
d 3 0.66667
SOLUTION
And
[U ]{ A1} {D}
0 A12 0
0.8 0.4
0
0.6
0.4 A22 1
0
0
0.53333 A32 0.66667
A32 1.25,
The second column of the inverse is
A22 2.5,
1.25
2 .5
1.25
A12 1.25
SOLUTION
For the third column,
0
[ L]{D} 0 ,
1
0
0 d1 0
1
0.5
1
0 d 2 0
0
0.66667 1 d 3 1
d1 0
0.5d1 d 2 0
0.66667 d 2 d 3 1
d1 0,
d 2 0,
d3 1
SOLUTION
And
[U ]{ A1} {D}
0 A13 0
0.8 0.4
0
0.6
0.4 A23 0
0
0
0.53333 A33 1
A33 1.875,
The third column of the inverse is
A23 1.25,
0.625
1.25
1.875
A13 0.625
SOLUTION
The matrix inverse is
1.875 1.25 0.625