Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement a set of functions in python to analyze and solve linear systems. Before starting, read the document on Piazza Linear Algebra in Python. Solving
Implement a set of functions in python to analyze and solve linear systems. Before starting, read the
document on Piazza Linear Algebra in Python.
Solving a linear system using Gaussian Elimination requires implementing three functions:
a forward elmination Stage
b testing for consistency
c backsubstitution Stage
I have written the code for forward elimination. Your job is to provide the rest of the code and use the resulting
set of functions to analyze some linear systems. In case it helps, the code you have to write is quite a bit
shorter than the code I have already supplied!
In hwGECode.py I have provided the function:
forwardEliminationB
which takes a matrix numpy array B and returns a new matrix that is the row echelon form of B There are also
helper functions in that file, for doing things like swapping rows of a matrix, doing row reduction, etc.
You need two write two functions:
inconsistentSystemB
which takes a matrix B in echelon form, and returns True if it represents an inconsistent system, and False
otherwise; and
backsubstitutionB
which returns the reduced row echelon form matrix of B
Using these, you should be able to analyze a matrix representing a linear system as follows:
AEchelon forwardEliminationA
if inconsistentSystemAEchelon:
AReducedEchelon backsubstitutionAEchelon
and then by inspecting AReducedEchelon you should be able to write down the solution set for the linear
system.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started