Question: Q1. (Gaussian elimination) Write a python code for solving a system of linear equations by Gaussian elimination. Written in matrix form, a system of linear

 Q1. (Gaussian elimination) Write a python code for solving a system

Q1. (Gaussian elimination) Write a python code for solving a system of linear equations by Gaussian elimination. Written in matrix form, a system of linear equations is expressed as Ax=b. 1. Define a function forward_elim(A, b) which takes in A and b, does forward elimination, and returns the new A and b after foward elimination. 2. Define a function backward_subs(A, b) which takes in the A and b obtained by foward elimination, does backward substitution, and returns the solution x. 3. Define a function gaussian_elim(a, b) which takes in the initial A and b and returns the solution x. In this function, we need to call the two functions defined in Q1.1 and 21.2. 4. Apply the function gaussian_elim(A, b) defined in Q1.3 to solve the following equations: 2 2 (3 1) ) -(0) (25 marks)

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!