Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Write a function in MATLAB that takes as an input a matrix of coefficients for a system of linear equations (A), the solution vector

image text in transcribed

3. Write a function in MATLAB that takes as an input a matrix of coefficients for a system of linear equations (A), the solution vector (b), an initial guess for the solution, a tolerance, and a maximum number of iterations. Have your function output the approximate solution of the system using the Gauss Seidel Method. (Hint: first line of your script should be the following: function [result,error.count] = GaussSeidel(A,b,x0,tol)) a. Test your function on the following system and output the result, final error, and number of iterations used. Use as a measure of error the difference between the last and current estimate. System: 12x+6y+3z+p = 27 12x + 20y +12+5p = 30 7x + 18y +30+4pz= 48 6x+7y+2z+22p=5 b. Solve the matrix equation Ax=b for an exact solution of the above system. Then compute the absolute and relative error between the Gauss- Seidel estimate and the exact solution for the variable x

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

=+What is your height and weight?

Answered: 1 week ago

Question

Discuss the history of human resource management (HRM).

Answered: 1 week ago