Numerical Linear Algebra(Numerical Method)
PLU Decomposition
A=[210814224−19724]
Find the PLU factorisation of the matrix above.
Solution:
1) Check for the dominant value in the first column
[100010001]A=[210814224−19724]
*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]
4) Check for the dominant value in the second column below the first row
[001010100]A=[100−141910−21901][−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=[100−141910−21901][−197240204192001901361979219]
6) Make the second column below the second row all become 0
R2(−23)+R3→R3
[001100010]A=[100−141910−219231][−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[100−141910−219231][−1972402041920019001043]
8) The final answer
PLU=[010001100][100−141910−219231][−1972402041920019001043]
QR Decomposition
A=[1−1414−21421−10]
Compute the QR decomposition of A
Solution:
let a1=[1111],a2=[−144−1],a3=[4−220]
f1=a1=[1111]
f2=a2−(f1⋅a2f1⋅f1)f1
f2=[−144−1]−62[1111]=[−525252−52]
f3=a3−(f1⋅a3f1⋅f1)f1−(f2⋅a3f2⋅f2)f2
f3=[4−220]−44[1111]−(−1025)[−525252−52]=[2−22−2]
Hence, Q=[f1‖f1‖,f2‖f2‖,f3‖f3‖]
Q=[12−12121212−1212121212−12−12]
Then, R=QTA
R=[12121212−121212−1212−1212−12][1−1414−21421−10]=[23205−2004]
The final answer will be
QR=[12−12121212−1212121212−12−12][23205−2004]
Strictly Diagonally Dominant
x1−10x2+x3=1320x1+x2−x3=17−x1+x2+10x3=18
|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+10x2−4x3=25−4x2+8x3−x4=−11−x3+5x4=−11
By using x(0)=0, find the first two iterations of the Jacobi method for the linear system above.
Solution:
[10500510−400−48−100−15][x1x2x3x4]=[625−11−11]
*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(6−5x(k)2)110(25−5x(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(6−5x(0)2)110(25−5x(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]=[6102510−118−115]
when k=1,
[x(2)1x(2)2x(2)3x(2)4]=[110(6−5x(1)2)110(25−5x(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]=[−13203320−25−9940]
Gauss-Seidel Method
By using x(0)=0, find the first two iterations of the Gauss-Seidel method for the linear system above.
[x(k+1)1x(k+1)2x(k+1)3x(k+1)4]=[110(6−5x(k)2)110(25−5x(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,...
[x(1)1x(1)2x(1)3x(1)4]=[110(6−5x(0)2)110(25−5x(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(6−5(0))=0.6x(1)2=110(25−5(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(6−5x(1)2)110(25−5x(2)1+4x(1)3)18(−11+4x(2)2+x(1)4)15(−11+x(2)3)]
x(2)1=110(6−5(2.2))=−0.5x(2)2=110(25−5(−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=[4−23−1]
→y1=[4−23−1][10]=[43]
b) let m1= dominant value in →y1=|4|=4
A=[210814224−19724]
Find the PLU factorisation of the matrix above.
Solution:
1) Check for the dominant value in the first column
[100010001]A=[210814224−19724]
*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)+R2→R2
R1(219)+R3→R3
[001010100]A=[100−141910−21901][−197240136197921902041920019]
4) Check for the dominant value in the second column below the first row
[001010100]A=[100−141910−21901][−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=[100−141910−21901][−197240204192001901361979219]
6) Make the second column below the second row all become 0
R2(−23)+R3→R3
[001100010]A=[100−141910−219231][−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[100−141910−219231][−1972402041920019001043]
8) The final answer
PLU=[010001100][100−141910−219231][−1972402041920019001043]
QR Decomposition
A=[1−1414−21421−10]
Compute the QR decomposition of A
Solution:
let a1=[1111],a2=[−144−1],a3=[4−220]
f1=a1=[1111]
f2=a2−(f1⋅a2f1⋅f1)f1
f2=[−144−1]−62[1111]=[−525252−52]
f3=a3−(f1⋅a3f1⋅f1)f1−(f2⋅a3f2⋅f2)f2
f3=[4−220]−44[1111]−(−1025)[−525252−52]=[2−22−2]
Hence, Q=[f1‖f1‖,f2‖f2‖,f3‖f3‖]
Q=[12−12121212−1212121212−12−12]
Then, R=QTA
R=[12121212−121212−1212−1212−12][1−1414−21421−10]=[23205−2004]
The final answer will be
QR=[12−12121212−1212121212−12−12][23205−2004]
Strictly Diagonally Dominant
x1−10x2+x3=1320x1+x2−x3=17−x1+x2+10x3=18
can be written as:
A=[201−11−101−1110]
⇒ A n × n matrix is called strictly diagonally dominant if |aii|>∑nj=1,j≠i|aij|
Means:
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+10x2−4x3=25−4x2+8x3−x4=−11−x3+5x4=−11
By using x(0)=0, find the first two iterations of the Jacobi method for the linear system above.
Solution:
[10500510−400−48−100−15][x1x2x3x4]=[625−11−11]
*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(6−5x(k)2)110(25−5x(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(6−5x(0)2)110(25−5x(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]=[6102510−118−115]
when k=1,
[x(2)1x(2)2x(2)3x(2)4]=[110(6−5x(1)2)110(25−5x(1)1+4x(1)3)18(−11+4x(1)2+x(1)4)15(−11+x(1)3)]
Gauss-Seidel Method
{10x1+5x2=65x1+10x2−4x3=25−4x2+8x3−x4=−11−x3+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(6−5x(k)2)110(25−5x(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(6−5x(0)2)110(25−5x(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(6−5(0))=0.6x(1)2=110(25−5(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(6−5x(1)2)110(25−5x(2)1+4x(1)3)18(−11+4x(2)2+x(1)4)15(−11+x(2)3)]
x(2)1=110(6−5(2.2))=−0.5x(2)2=110(25−5(−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=[4−23−1]
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:
Solution:
Given that →x0=[10],
Iteration 1:
Iteration 1:
When k = 1,
a) Find →y1=A→x0
→y1=[4−23−1][10]=[43]
b) let m1= dominant value in →y1=|4|=4
c) Find the corresponding eigenvector using →x1=1m1→y1
→x1=14[43]=[10.75]
→y2=[4−23−1][10.75]=[2.52.25]
b) let m2= dominant value in →y1=|2.5|=2.5
→y3=[4−23−1][10.9]=[2.22.1]
b) let m3= dominant value in →y2=|2.2|=2.2
→x1=14[43]=[10.75]
Iteration 2:
When k = 2,
a) Find →y2=A→x1
→y2=[4−23−1][10.75]=[2.52.25]
b) let m2= dominant value in →y1=|2.5|=2.5
c) Find the corresponding eigenvector using →x2=1m2→y2
→x2=12.5[2.52.25]=[10.9]
→x2=12.5[2.52.25]=[10.9]
Iteration 2:
When k = 2,
a) Find →y3=A→x2
→y3=[4−23−1][10.9]=[2.22.1]
b) let m3= dominant value in →y2=|2.2|=2.2
c) Find the corresponding eigenvector using →x3=1m3→y3
→x3=12.2[2.22.1]=[10.954545]
→x3=12.2[2.22.1]=[10.954545]
Comments
Post a Comment