Skip to content

srisaran44/LU-Decomposition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

LU Decomposition

AIM:

To write a program to find the LU Decomposition of a matrix.

Equipments Required:

  1. Hardware – PCs
  2. Anaconda – Python 3.7 Installation / Moodle-Code Runner

Algorithm

  1. DEVELOPE THE CONSUMING NUMPY TO INPUT
  2. ENSURE THE SCIPY(USING LINALG)
  3. GET INPUT ASUME THREE VAR().
  4. RETURN THE FOLLOWING ASSUMED VARIABLES

Program:

(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)
*/

Output:

image image

Result:

Thus the program to find the LU Decomposition of a matrix is written and verified using python programming.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%