To write a program to find the LU Decomposition of a matrix.
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
- DEVELOPE THE CONSUMING NUMPY TO INPUT
- ENSURE THE SCIPY(USING LINALG)
- GET INPUT ASUME THREE VAR().
- RETURN THE FOLLOWING ASSUMED VARIABLES
(i) To find the L and U matrix
/*
Program to find the L and U matrix.
Developed by: SRI SARAN J.
RegisterNumber: 212225240159
import numpy as np
from scipy.linalg import lu
A=np.array(eval(input()))
p,l,u=lu(A)
print(l)
print(u)
*/
(ii) To find the LU Decomposition of a matrix
/*
Program to find the LU Decomposition of a matrix.
Developed by: SRI SARAN .J
RegisterNumber: 212225240159
import numpy as np
from scipy.linalg import lu_factor,lu_solve
A=np.array(eval(input()))
B=np.array(eval(input()))
lu,pivot=lu_factor(A)
X=lu_solve((lu,pivot),B)
print(X)
*/
Thus the program to find the LU Decomposition of a matrix is written and verified using python programming.