Question: Develop your own M-file function for the Gauss- Seidel method without relaxation based on Fig. 12.2, but change the first line so that it returns

Develop your own M-file function for the Gauss- Seidel method without relaxation based on Fig. 12.2, but change the first line so that it returns the approximate error and the number of iterations:

function [x,ea,iter] = ...
Gauss Seidel (A,b,es, maxit)

function x = Gauss Seidel (A, b, es, maxit) & GaussSeidel: Gauss

Test it by duplicating Example 12.1 and then use it to solve Prob. 12.2a.


Example 12.1

Seidel method $ x = GaussSeidel (A,b): Gauss Seidel without relaxation &


Data From Problem 12.2

(a) Use the Gauss-Seidel method to solve the following system until the percent relative error falls below ε= 5%:

input: .. A = coefficient matrix 8 bright hand side vector 8

(b) Repeat (a) but use overrelaxation with λ = 1.2.

function x = Gauss Seidel (A, b, es, maxit) & GaussSeidel: Gauss Seidel method $ x = GaussSeidel (A,b): Gauss Seidel without relaxation & input: .. A = coefficient matrix 8 bright hand side vector 8 es = stop criterion (default = 0.000018) 8 maxit = max iterations (default = 50) $output: 8 x = solution vector if nargin

Step by Step Solution

3.48 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question provides a MATLAB Mfile function for the GaussSeidel iterative method for solving linear systems and asks to modify the function to retur... View full answer

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 Applied Numerical Methods Questions!