Posts

Showing posts with the label LU decompose

mathajax

Inverse Matrix by LU Decomposition

One of the application of LU matrix decomposition finds inverse of a square matrix,A. A A -1 = I The square matrix (coefficient matrix) A decomposed into LU (lower triangular and upper triangular) matrix by elementary-row-operations . A = LU after that, inverse matrix A -1 is found by applying forward and back substitution on each column of identity matrix, I and place returning solution vectors x to column of A -1 matrix. Algorithm steps for Matrix Inverse by LU Decomposition Input : a square matrix , A Output : a square matrix, A -1 read matrix A [L,U]= LUDecompose (A) [nrow,ncol]=size(A) I = Identity-matrix(nrow,ncol); iA = zero-matrix(nrow,ncol); For c =1 to ncol Y = forward-substitute (L,I(c)) X = back-substitute (U,Y) A -1 (c,:) = X // set vector X to column of A -1 ...

Solve System of Linear Equations by LU Decompose

Image
One of the application of LU matrix decomposition is solving system of linear equations. Ax = b A - coefficient matrix b - non-homogeneous vector x - unknown vector (solution vector) The square matrix (coefficient matrix) A decomposed into LU (lower triangular and upper triangular) matrix by elementary-row-operations. A = LU the solution vector X of system found by forward and back substitution. y = forward-substitute L and b X = back-substitute U and y The two or more system of equations have same coefficient matrix A but have different non-homogeneous vectors (b1 ,b2,..), the solutions vectors (x1,x2,..) obtained by once applying LU decomposition over matrix A. System 1 &nbsp&nbsp Ax = b1 ...

Matrix A = LU Decompose

Image
LU decompose - a square matrix A that can be expressed as product of L and U matrix, is called LU decomposition. A = LU Matrix L - It is called Lower triangular Matrix , whose elements above the main diagonal is zero valued elements. Matrix U - It is called Upper Triangular Matrix , whose elements below the main diagonal is zero valued elements. How to LU decompose - a square matrix A is decomposed or factorized into L and U matrix by elementary row operation , such as swapping two rows and adding or subtracting row by a scalar value. Application of LU decompose It is useful to find solution of system of linear equation and matrix inverse. Algorithm steps for A= LU decompose Read matrix A U = copy (A) L = Identity-matrix() i,j - position of a element in the matrix For i=1 To N Eor j=i+1 To N lambda=U ji /U ii R j <- R j - lambda ...