We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
2info Univ_Bouira
TP05_ NM: GAUSS ELIMINATION METHOD (Continued)
Exo_01: GAUSS ELIMINATION Method Write a python script of the GAUSS elimination method, for this: - Read the order of the system, the square matrix A and the array Y. - Use a function to triangularize the matrix A. - Use a function to calculate the solution X. import numpy as np # Function to perform Gaussian elimination and convert the matrix to upper triangular form def Triang(m, Y): ………………………………………….. return m, Y # Function to perform back substitution and find the solution def backSub(m, Y): ………………………………………….. return X # Input the order of the system n = int(input("Enter the system order: "))
# Initialize and input matrix A
………………………………………….. # Initialize and input vector Y …………………………………………..
# Apply Gaussian elimination to transform A into an upper triangular matrix