Question: PLease command on each line you have written on what you are going to accomplish thank you c) Write a function defined as: def GaussSeidel

PLease command on each line you have written on what you are going to accomplish thank you

PLease command on each line you have written on what you are

going to accomplish thank you c) Write a function defined as: def

c) Write a function defined as: def GaussSeidel (Aaug, x, Niter 15) : Purpose: use the Gauss-Seidel method to estimate the solution to a set of N linear equations expressed in matrix form as Ax = b. Both A and b are contained in the function argument Aaug. Aaug: an augmented matrix containing [A | b] having N rows and N+1 columns, where N is the number of equations in the set. x: a vector (array) contain the values of the initial guess Niter: the number of iterations (new x vectors) to compute return value: the final new x vector. Write and call a main () function that uses your GaussSeidel function to estimate and print the solutions to the following sets of linear equations: 3 1 -1|| x 2 1 4 1 X2 12 2 1 2 X2 10 1 2 3 12 -10 2 4 || x1 1 4 12 || x2 2 3 4 2 7 3 X4 = 9 21 -1 37 d) Write a function defined as: def Inverse (A) : Purpose of Inverse (A): use the Gauss-Jordan Elimination* to find the inverse of the A matrix. A: is a square matrix of n-rows by n-cols. return value: A-7 is the inverse of matrix A Write and call a main () function that uses your Inverse function to calculate and print the solution A-1 matrix for the A matrices of part c). Also, verify that A-7 is in fact the inverse of A by performing the operation A-1A and obtaining the proper identity matrix. Use the inverse matricies to solve the equations in part c) and output the result to the console. Output statements should be informative and nicely formatted. *note: you may use my code hw2d-stem.py as a starting point for part d. c) Write a function defined as: def GaussSeidel (Aaug, x, Niter 15) : Purpose: use the Gauss-Seidel method to estimate the solution to a set of N linear equations expressed in matrix form as Ax = b. Both A and b are contained in the function argument Aaug. Aaug: an augmented matrix containing [A | b] having N rows and N+1 columns, where N is the number of equations in the set. x: a vector (array) contain the values of the initial guess Niter: the number of iterations (new x vectors) to compute return value: the final new x vector. Write and call a main () function that uses your GaussSeidel function to estimate and print the solutions to the following sets of linear equations: 3 1 -1|| x 2 1 4 1 X2 12 2 1 2 X2 10 1 2 3 12 -10 2 4 || x1 1 4 12 || x2 2 3 4 2 7 3 X4 = 9 21 -1 37 d) Write a function defined as: def Inverse (A) : Purpose of Inverse (A): use the Gauss-Jordan Elimination* to find the inverse of the A matrix. A: is a square matrix of n-rows by n-cols. return value: A-7 is the inverse of matrix A Write and call a main () function that uses your Inverse function to calculate and print the solution A-1 matrix for the A matrices of part c). Also, verify that A-7 is in fact the inverse of A by performing the operation A-1A and obtaining the proper identity matrix. Use the inverse matricies to solve the equations in part c) and output the result to the console. Output statements should be informative and nicely formatted. *note: you may use my code hw2d-stem.py as a starting point for part d

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!