Develop your own M-file function for the Gauss- Seidel method without relaxation based on Fig. 12.2, but

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 the approximate error and the number of iterations:

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

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


Example 12.1


Data From Problem 12.2

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

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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: