Numerical Linear Algebra(Numerical Method)

PLU Decomposition

A=[21081422419724]

Find the PLU factorisation of the matrix above.

Solution:

1) Check for the dominant value in the first column
[100010001]A=[21081422419724]

*Compare the absolute value of the first column numbers and find the dominant (largest) value |2|=2,|14|=14,|19|=19, therefore, 19 have the dominant value

2) Change the row that have the dominant value to the  first row (Remember to change the row of the identity matrix) *if necessary

[001010100]A=[19724142242108]

3) Make first column below the first row all become 0
R1(1419)+R2R2
R1(219)+R3R3

[001010100]A=[10014191021901][197240136197921902041920019]

4) Check for the dominant value in the second column below the first row
[001010100]A=[10014191021901][197240136197921902041920019]

*Compare the absolute value of the first column numbers and find the dominant (largest) value |13619|=7.15789473684,|20419|=10.7368421053, therefore, 20419 have the dominant value

5) Change the row that have the dominant value to the  second row (Remember to change the row of the identity matrix) *if necessary
[001100010]A=[10014191021901][197240204192001901361979219]

6) Make the second column below the second row all become 0
R2(23)+R3R3

[001100010]A=[100141910219231][1972402041920019001043]

7) If both of the matrix in right hand side become upper triangular and lower triangular matrix, then find the inverse of the left hand side matrix and multiply with the right hand side matrix

PLU=[001100010]1[100141910219231][1972402041920019001043]

8) The final answer
PLU=[010001100][100141910219231][1972402041920019001043]



QR Decomposition

A=[114142142110]

Compute the QR decomposition of A

Solution:

let a1=[1111],a2=[1441],a3=[4220]
f1=a1=[1111]

f2=a2(f1a2f1f1)f1

f2=[1441]62[1111]=[52525252]

f3=a3(f1a3f1f1)f1(f2a3f2f2)f2
f3=[4220]44[1111](1025)[52525252]=[2222]

Hence, Q=[f1f1,f2f2,f3f3]
Q=[121212121212121212121212]

Then, R=QTA

R=[121212121212121212121212][114142142110]=[232052004]


The final answer will be

QR=[121212121212121212121212][232052004]





Strictly Diagonally Dominant


x110x2+x3=1320x1+x2x3=17x1+x2+10x3=18

can be written as:
 A=[201111011110]

A n × n matrix is called strictly diagonally dominant if |aii|>nj=1,ji|aij|

Means:

|a11|>|a12|+|a13||a22|>|a21|+|a23||a33|>|a31|+|a32|


So, A is strictly diagonally dominant matrix, because:

|20|>|1|+|1||10|>|1|+|1||10|>|1|+|1|




Jacobi Method

{10x1+5x2=65x1+10x24x3=254x2+8x3x4=11x3+5x4=11


By using x(0)=0, find the first two iterations of the Jacobi method for the linear system above.


Solution:

[105005104004810015][x1x2x3x4]=[6251111]

*Check whether the matrix is strictly diagonally dominant


|10|>|5|+|0|+|0||10|>|5|+|4|+|0||8|>|0|+|4|+|1||5|>|0|+|0|+|1|
The matrix is strictly diagonally dominant


Deriving the Jacobi iteration:

[x(k+1)1x(k+1)2x(k+1)3x(k+1)4]=[110(65x(k)2)110(255x(k)1+4x(k)3)18(11+4x(k)2+x(k)4)15(11+x(k)3)],k=0,1,2,3,...

when k=0,

[x(1)1x(1)2x(1)3x(1)4]=[110(65x(0)2)110(255x(0)1+4x(0)3)18(11+4x(0)2+x(0)4)15(11+x(0)3)],Given that x(0)=0

[x(1)1x(1)2x(1)3x(1)4]=[6102510118115]

when k=1,


[x(2)1x(2)2x(2)3x(2)4]=[110(65x(1)2)110(255x(1)1+4x(1)3)18(11+4x(1)2+x(1)4)15(11+x(1)3)]

[x(2)1x(2)2x(2)3x(2)4]=[13203320259940]



Gauss-Seidel Method

{10x1+5x2=65x1+10x24x3=254x2+8x3x4=11x3+5x4=11 

By using x(0)=0, find the first two iterations of the Gauss-Seidel method for the linear system above.

Deriving the Gauss-Seidel iteration:

[x(k+1)1x(k+1)2x(k+1)3x(k+1)4]=[110(65x(k)2)110(255x(k+1)1+4x(k)3)18(11+4x(k+1)2+x(k)4)15(11+x(k+1)3)],k=0,1,2,3,...

when k=0,

[x(1)1x(1)2x(1)3x(1)4]=[110(65x(0)2)110(255x(1)1+4x(0)3)18(11+4x(1)2+x(0)4)15(11+x(1)3)],Given that x(0)=0

x(1)1=110(65(0))=0.6x(1)2=110(255(0.6)+4(0))=2.2x(1)3=18(11+4(2.2)+0)=0.275x(1)4=15(11+(0.275))=2.255

when k=1,

[x(2)1x(2)2x(2)3x(2)4]=[110(65x(1)2)110(255x(2)1+4x(1)3)18(11+4x(2)2+x(1)4)15(11+x(2)3)]

x(2)1=110(65(2.2))=0.5x(2)2=110(255(0.5)+4(0.275))=2.64x(2)3=18(11+4(2.64)+(2.255))=0.336875x(2)4=15(11+(0.336875))=2.267375


Power Method

A=[4231]

Use power method to approximate the dominant eigenvalue and corresponding eigenvector with 3 iteration.

Note: If didn't stating x0, we will always take x0=[10]

Solution:

Given that x0=[10],

Iteration 1:

When k = 1,

a) Find y1=Ax0

y1=[4231][10]=[43]

b) let m1= dominant value in y1=|4|=4

c) Find the corresponding eigenvector using x1=1m1y1

x1=14[43]=[10.75]

Iteration 2:

When k = 2,

a) Find y2=Ax1

y2=[4231][10.75]=[2.52.25]

b) let m2= dominant value in y1=|2.5|=2.5

c) Find the corresponding eigenvector using x2=1m2y2

x2=12.5[2.52.25]=[10.9]

Iteration 2:

When k = 2,

a) Find y3=Ax2

y3=[4231][10.9]=[2.22.1]

b) let m3= dominant value in y2=|2.2|=2.2

c) Find the corresponding eigenvector using x3=1m3y3

x3=12.2[2.22.1]=[10.954545]






Comments

Popular Posts