Question: Problem Description: As a follow-up of Computer Lab #9, use the Gauss-Seidel method with relaxation to solve the following system to a specified tolerance ?_s%
Problem Description: As a follow-up of Computer Lab #9, use the Gauss-Seidel method with relaxation to solve the following system to a specified tolerance ?_s% (approximate absolute percent relative error). If necessary, rearrange the equations to achieve convergence.
10x_1 + 2x_2 ? x_3 = 27
x_1 + x_2 + 5x_3 = ?21.5
?3x_1 ? 6x_2 + 2x_3 = ?61.5
The relaxation parameter (?) should be an input parameter of your function.
Given Code
function x=GaussSeidel_Relax_Example(lambda, es)
% Gauss-Seidel for a 3-by-3 linear system of equations
%
%--Input
% lambda: relaxation parameter
% es: error tolerance (approximate absolute percent relative error in solution)
%
%--Output
% x: Gauss-Seidel linear solution (3-by-1 vector)
% Note: You may need to rearrange the linear equations to achieve diagonal dominance.
% Write your code here.
Please write in Matlab
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
