Solve Equations x+y+z=3,2x-y-z=3,x-y+z=9 using LU decomposition using Gauss Elimination methodSolution:Total Equations are `3`
`x+y+z=3 -> (1)`
`2x-y-z=3 -> (2)`
`x-y+z=9 -> (3)`
Now converting given equations into matrix form
`[[1,1,1],[2,-1,-1],[1,-1,1]] [[x],[y],[z]]=[[3],[3],[9]]`
Now, A = `[[1,1,1],[2,-1,-1],[1,-1,1]]`, X = `[[x],[y],[z]]` and B = `[[3],[3],[9]]`
`LU` decomposition : If we have a square matrix A, then an upper triangular matrix U can be obtained without pivoting under Gaussian Elimination method, and there exists lower triangular matrix L such that A=LU.
Here `A` | = | | `1` | `1` | `1` | | | `2` | `-1` | `-1` | | | `1` | `-1` | `1` | |
|
Using Gaussian Elimination method
`R_2 larr R_2-`
`(2)``xx R_1` `[:.L_(2,1)=color{blue}{2}]`
= | | `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `1` | `-1` | `1` | |
|
`R_3 larr R_3-`
`(1)``xx R_1` `[:.L_(3,1)=color{blue}{1}]`
= | | `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `0` | `-2` | `0` | |
|
`R_3 larr R_3-`
`(2/3)``xx R_2` `[:.L_(3,2)=color{blue}{2/3}]`
= | | `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `0` | `0` | `2` | |
|
`:.U` | = | | `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `0` | `0` | `2` | |
|
`L` is just made up of the multipliers we used in Gaussian elimination with 1s on the diagonal.
`:.L` | = | | `1` | `0` | `0` | | | `color{blue}{2}` | `1` | `0` | | | `color{blue}{1}` | `color{blue}{2/3}` | `1` | |
|
`:.` LU decomposition for A is
`A` | = | | `1` | `1` | `1` | | | `2` | `-1` | `-1` | | | `1` | `-1` | `1` | |
| = | | `1` | `0` | `0` | | | `2` | `1` | `0` | | | `1` | `2/3` | `1` | |
| `xx` | | `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `0` | `0` | `2` | |
| = | `LU` |
Now, `Ax=B`, and `A=LU => LUx=B`
let `Ux=y`, then `Ly=B =>`
| `1` | `0` | `0` | | | `2` | `1` | `0` | | | `1` | `2/3` | `1` | |
| `xx` | | = | |
| | | `` | `y_1` | | | | | `=` | `3` | `` |
| | | `` | `2y_1` | `+` | `y_2` | | | `=` | `3` | `` |
| | | `` | `y_1` | `+` | `2/3y_2` | `+` | `y_3` | `=` | `9` | `` |
Now use forward substitution method
From (1)
`y_1=3`
From (2)
`2y_1+y_2=3`
`=>2(3)+y_2=3`
`=>6+y_2=3`
`=>y_2=3-6`
`=>y_2=-3`
From (3)
`y_1+2/3y_2+y_3=9`
`=>(3)+(2(-3))/(3)+y_3=9`
`=>1+y_3=9`
`=>y_3=9-1`
`=>y_3=8`
Now, `Ux=y`
| `1` | `1` | `1` | | | `0` | `-3` | `-3` | | | `0` | `0` | `2` | |
| `xx` | | = | |
| | | `` | `x` | `+` | `y` | `+` | `z` | `=` | `3` | `` |
| | | | | `-` | `3y` | `-` | `3z` | `=` | `-3` | `` |
| | | | | | | `` | `2z` | `=` | `8` | `` |
Now use back substitution method
From (3)
`2z=8`
`=>z=(8)/(2)=4`
From (2)
`-3y-3z=-3`
`=>-3y-3(4)=-3`
`=>-3y-12=-3`
`=>-3y=-3+12`
`=>-3y=9`
`=>y=(9)/(-3)=-3`
From (1)
`x+y+z=3`
`=>x+(-3)+(4)=3`
`=>x+1=3`
`=>x=3-1`
`=>x=2`
Solution by LU decomposition method is
`x=2,y=-3 and z=4`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then