Use the GaussSeidel method to solve the following linear sys
Use the Gauss-Seidel method to solve the following linear system.
3x1 - x2 + x3 = 1,
3x1 + 6x2 + 2x3 = 0,
3x1 + 3x2 + 7x3 = 4.
Solution
Let\'s apply the Gauss-Seidel Method to the system from Example 1:
3x1 - x2 + x3 = 1,
3x1 + 6x2 + 2x3 = 0,
3x1 + 3x2 + 7x3 = 4.
At each step, given the current values x1(k), x2(k), x3(k), we solve for x1(k+1), x2(k+1), x3(k+1) in
3x1k+1 - x2k + x3k = 1,
3x1k+1 + 6x2k+1 + 2x3k = 0,
3x1k+1 + 3x2k+1 + 7x3k+1 = 4.
To compare our results from the two methods, we again choose x(0) = (0, 0, 0). We then find x(1) = (x1(1), x2(1), x3(1))by solving
3x11 - 0 +0 = 1,
3x11 + 6x21 + 0 = 0,
3x11 + 3x21 + 7x31 = 4.
Let us be clear about how we solve this system. We first solve for x1(1) in the first equation and find that
x1(1) = 1/3
We then solve for x2(1) in the second equation, using the new value of x1(1) = 1/3, and find that
x2(1) = [0 - 3(1/3)] / 6 = -1/6.
Finally, we solve for x3(1) in the third equation, using the new values of x1(1) = 1/3 and x2(1) = -1/6, and find that
x3(1) = [4 - 3(1/3) ? - 3(1/6)] / 7 = 7/2=3.5
The result of this first iteration of the Gauss-Seidel Method is
x(1) = (x1(1), x2(1), x3(1)) = (1/3, -1/6, 3.5).
