Find Matrix Inverse Using LU Decomposition
Total Page:16
File Type:pdf, Size:1020Kb
EXERCISE: Find Matrix Inverse using LU Decomposition
Use LU decomposition to determine the matrix inverse for the following system. Do not use a pivoting strategy, and check your results by verifying that AA1 I .
10x1 2x2 x3 27
3x1 6x2 2x3 61.5
x1 x2 5x3 21.5
Solution:
First, we compute the LU decomposition. The coefficient a21 is eliminated by multiplying row 1 by f21 = –3/10 = –0.3 and subtracting the result from row 2. a31 is eliminated by multiplying row 1 by f31 = 1/10 = 0.1 and subtracting the result from row 3. The factors f21 and f31 can be stored in a21 and a31.
10 2 1 0.3 5.4 1.7 0.1 0.8 5.1
a32 is eliminated by multiplying row 2 by f32 = 0.8/(–5.4) = –0.148 and subtracting the result from row 3. The factor f32 can be stored in a32.
10 2 1 0.3 5.4 1.7 0.1 0.148 5.352 Therefore, the LU decomposition is
1 0 0 10 2 1 [L] 0.3 1 0 [U ] 0 5.4 1.7 0.1 0.1481 1 0 0 5.352
The first column of the inverse can be computed by solving [L] {D} = {B} using Forward Substitution.
1 0 0d1 1 0.3 1 0 d 0 2 0.1 0.148 1d3 0
This can be solved for d1 = 1, d2 = 0.3, and d3 = 0.055. Then, we can implement Back Substitution
轾10 2- 1 禳x 禳 1 镲11 镲 犏0- 5.4 1.7x = 0.3 犏 睚12 睚 镲 镲 臌犏0 0 5.352 铪x13 铪- 0.055 to yield the first column of the inverse
禳0.111 镲 {X 1}=睚 - 0.059 镲 铪-0.0104 For the second column use {B}T = {0 1 0} which gives {D}T = {0 1 0.148}. Then, Back substitution gives {X2}T = {0.038 0.176 0.028}.
For the third column use {B}T = {0 0 1} which gives {D}T = {0 0 1}. Back substitution then gives {X3}T = {0.0069 0.059 0.187}.
Therefore, the matrix inverse is
0.111 0.038 0.0069 1 [A] 0.059 0.176 0.059 0.0104 0.028 0.187
We can verify that this is correct by multiplying [A][A]–1 to yield the identity matrix. For example, using MATLAB,
>> A=[10 2 -1;-3 -6 2;1 1 5];
>> AI=[0.111 0.038 0.0069; -0.059 -0.176 0.059; -0.0104 0.028 0.187];
>> A*AI ans = 1.0000 -0.0000 -0.0000 0.0000 1.0000 -0.0000 -0.0000 0.0000 1.0000