Академический Документы
Профессиональный Документы
Культура Документы
• The program generates a random tridiagonal matrix as per the definition provided in the
question & solves the system of equations.
• First step is decomposing the co-efficient matrix in lower & upper triangular matrix.
• Second step is solving the system with upper triangular matrix & constant vector.
• Result of second step is then utilised to calculate the solution with lower triangular matrices.
A=
88 55 0 0
2 26 78 0
0 46 66 58
0 0 77 26
L=
1 0 0 0
0.022727 1 0 0
0 1.858586 1 0
0 0 -0.9750575 1
U=
88 55 0 0
0 24.75 78 0
0 0 -78.969696 58
0 0 77 26
b=
13
99
43
50
y=
13
98.70454545
-140.450872
-86.9476848
x=
0.14772727
3.98806244
1.77854136
-86.947684
• Flop counts for tridiagonal system is of order of 3n, where n is the number of equations.
• Flop counts for general system is of order of (2/3)n^3, where n is the number of equations.
A=
2 1 1 0
4 3 3 1
8 7 9 5
6 7 9 8
U=
8 7 9 5
0 1.75 2.25 4.25
- -
0 0 0.857142857 0.285714286
0 0 0 0.666666667
L=
1 0 0 0
0.75 1 0 0
0.5 -0.2857 1 0
0.25 -0.4285 0.33333333 1
P=
0 0 1 0
0 0 0 1
0 1 0 0
1 0 0 0
Question.2.2.A. Classical GS
• Here we observe that results of Classical & modified GS is same. However, error is less in
Modified GS as compared to Classical GS
A=
22 60 70 89 61
55 44 55 51 70
47 12 68 6 53
42 22 3 15 17
92 85 67 71 80
Q=
R=
Modified GS
A=
22 60 70 89 61
55 44 55 51 70
47 12 68 6 53
42 22 3 15 17
92 85 67 71 80
Q=
Question.2.2.B. Errors for given combination for identity & Hilbert matrix
Aeye=
Hilb=
A=
Q=
R=
Q*Q^T=
Error=
Q=
R=
Q*Q^T=
Error=