Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB Gauss & Back Substitution Gauss & Back Substitution Obiective: Write a function script (Solve.m) and a test script (test.m) that will solve and test
MATLAB Gauss & Back Substitution
Gauss & Back Substitution Obiective: Write a function script (Solve.m) and a test script (test.m) that will solve and test an arbitrary system (Ax - b) of N linear equations in N unknowns, using the Gaussian Elimination (GE) and Back Substitution algorithms as covered in the class . Scripts must include all the typical required codes, comments, and headers. . Function script must have two input arguments (A & b) and four output arguments (A',b', X, and Xinv Function script must check that the coefficient matrix A is square (m-n). If not, display an error message to the user, explaining the error . WARNING: For this assignment, you may only use the MATLAB codes discussed and practiced in the class notes. Any deviation will result in a grade of zero for this assignment. Copying is strongly discouraged NOTE: You may use the MATLAB built-in function, table(). I. Row Echelon Form (REF)/ Upper Triangular Form Execute Gaussian Elimination (GE) to get the equivalent matrix in Row-Echelon-Form (REF): a) Check for "near-zero" pivots in each column, and do a row swap R Rj if there is a near- zero pivot. b) Define a number to be "near-zero" if its magnitude is less than.01 c) When deciding what row to swap, make the pivot the number with the largest magnitude in the column you are working on, for improved numerical stability Get zeros beneath the pivot in each column. d) Il. Back-substitution Execute Back-Substitution to determine the values of all unknowns (all components of vector x). Confirm results (values) using MATLAB inv) function III. Systems-of-Equations Use the following Systems-of-Equations to test drive your function x +z 12 2x-y- z 1 2x - 2y -z-1 x - y + 2z 4z -44 22 4 0.0001x +y-1 Gauss & Back Substitution Obiective: Write a function script (Solve.m) and a test script (test.m) that will solve and test an arbitrary system (Ax - b) of N linear equations in N unknowns, using the Gaussian Elimination (GE) and Back Substitution algorithms as covered in the class . Scripts must include all the typical required codes, comments, and headers. . Function script must have two input arguments (A & b) and four output arguments (A',b', X, and Xinv Function script must check that the coefficient matrix A is square (m-n). If not, display an error message to the user, explaining the error . WARNING: For this assignment, you may only use the MATLAB codes discussed and practiced in the class notes. Any deviation will result in a grade of zero for this assignment. Copying is strongly discouraged NOTE: You may use the MATLAB built-in function, table(). I. Row Echelon Form (REF)/ Upper Triangular Form Execute Gaussian Elimination (GE) to get the equivalent matrix in Row-Echelon-Form (REF): a) Check for "near-zero" pivots in each column, and do a row swap R Rj if there is a near- zero pivot. b) Define a number to be "near-zero" if its magnitude is less than.01 c) When deciding what row to swap, make the pivot the number with the largest magnitude in the column you are working on, for improved numerical stability Get zeros beneath the pivot in each column. d) Il. Back-substitution Execute Back-Substitution to determine the values of all unknowns (all components of vector x). Confirm results (values) using MATLAB inv) function III. Systems-of-Equations Use the following Systems-of-Equations to test drive your function x +z 12 2x-y- z 1 2x - 2y -z-1 x - y + 2z 4z -44 22 4 0.0001x +y-1
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