LU Decomposition
LU Decomposition is a method to find solutions of linear equations.
Using Gauss Elimination Method
Consider a matrix ๐ด. If all entries below the diagonal entries are zero, then the matrix is called “upper triangular.” If all entries above the diagonal entries are zero, then the matrix is called “lower triangular.”
And A = L*U
L= lower triangular matrix; U= upper triangular matrix
Procedure-
- Choose a matrix (m X n) (e.g., 3X 3, 3 X 4, 4 X 4, etc.,)
- Initialize the L and U matrices. For L matrix, take a matrix with all diagonal elements assigned to 1, and the remaining components are zero. L matrix size will be (m X m).
- Consider the U matrix's elements to be same to those of the A matrix. So, size of matrix U will be as same as matrix A.
- 4. Next, execute row operations on the U matrix to make sure that all of the components below the diagonal are zeroes. For instance, to make an element in row 2 or R2 at the (i,j)th position zero, we would first do
"R2 - (-2)*R1"
and then set the value ‘(-2)’ at the (i,j)th place of the L Matrix.
- For a given matrix
A=L*U
L= lower triangular matrix; U= upper triangular matrix
After doing the row operation "R2 - (-2)*R1," we get,
After row operation in matrix U, we've set (-2) to the same place of the L matrix and the (2, 1)th position of the U matrix, which is now zero.
Firstly, try the first column elements of matrix U below diagonal elements to make zeroes,
After doing, ‘R2-(-2)*R1’ (as demonstrated above)
‘R3-(3)*R1’ and
‘R4-(2)*R1’
We get,
In a same way, we will now employ row operations to set the elements of the second column of matrix U to zero.
Calculate, ‘R3-(-4)*R2’ and
‘R4-(1)*R2’
We get,
Now, we'll apply row operations to convert the elements of the third column of matrix U to zeroes.
Now calculate "R4-(3)*R2"
We get,
So,