Question #75211

solve the system of equations
8x1 -x2 +2x3 =4
-3x1 +11x2 -x3 +3x4 =23
_x2 +10x3 -x4 =-13
_2x1 +x2 -x3 +8x4 =13
with x^(0) =[0 0 0 0]^T by using the Gauss Jacoboi and Gauss Seidel method. The exact solution of the system is x=[1 2 -1 1]^T. Perform the required number of iteration so that the same accuracy is obtained by birth the methods. What conclusions can you draw from the result obtained?

Expert's answer

Answer on Question #75211- Math - Linear Algebra

solve the system of equations


{8x1x2+2x3=43x1+11x2x3+3x4=23x2+10x3x4=132x1+x2x3+8x4=13\left\{ \begin{array}{c} 8 x 1 - x 2 + 2 x 3 = 4 \\ - 3 x 1 + 11 x 2 - x 3 + 3 x 4 = 23 \\ x 2 + 10 x 3 - x 4 = -13 \\ 2 x 1 + x 2 - x 3 + 8 x 4 = 13 \end{array} \right.


with x(0)=[0000]Tx^{(0)} = [0 0 0 0]^T by using the Gauss Jacoboi and Gauss Seidel method. The exact solution of the system is x=[1211]Tx = [1 2 - 1 1]^T. Perform the required number of iteration so that the same accuracy is obtained by birth the methods. What conclusions can you draw from the result obtained?

Solution

Apply Jacobi's method to the system


{8x1x2+2x3=43x1+11x2x3+3x4=23x2+10x3x4=132x1+x2x3+8x4=13\left\{ \begin{array}{c} 8 x 1 - x 2 + 2 x 3 = 4 \\ - 3 x 1 + 11 x 2 - x 3 + 3 x 4 = 23 \\ x 2 + 10 x 3 - x 4 = -13 \\ 2 x 1 + x 2 - x 3 + 8 x 4 = 13 \end{array} \right.


Take x(0)=[0000]Tx^{(0)} = [0 0 0 0]^T as an initial approximation to the solution, and use six iterations (that is, compute x(1),,x(9)x^{(1)}, \ldots, x^{(9)}).

For some kk, denote the entries in x(k)x^{(k)} by (x1,x2,x3,x4)(x1, x2, x3, x4) and the entries in x(k1)x^{(k-1)} by (y1,y2,y3,y4)(y1, y2, y3, y4). The recursion


[800001100001000008][y1y2y3y4]=[0120301301012110][x1x2x3x4]+[4231313]\left[ \begin{array}{ccccc} 8 & 0 & 0 & 0 \\ 0 & 11 & 0 & 0 \\ 0 & 0 & 10 & 0 \\ 0 & 0 & 0 & 8 \end{array} \right] \left[ \begin{array}{c} y1 \\ y2 \\ y3 \\ y4 \end{array} \right] = \left[ \begin{array}{ccccc} 0 & 1 & -2 & 0 \\ 3 & 0 & 1 & -3 \\ 0 & -1 & 0 & 1 \\ -2 & -1 & 1 & 0 \end{array} \right] \left[ \begin{array}{c} x1 \\ x2 \\ x3 \\ x4 \end{array} \right] + \left[ \begin{array}{c} 4 \\ 23 \\ -13 \\ 13 \end{array} \right]


can be written as


{8y1=x22x3+411y2=3x1+x33x4+2310y3=x2+x4138y4=2x1x2+x3+13\left\{ \begin{array}{c} 8 y 1 = x 2 - 2 x 3 + 4 \\ 11 y 2 = 3 x 1 + x 3 - 3 x 4 + 23 \\ 10 y 3 = - x 2 + x 4 - 13 \\ 8 y 4 = - 2 x 1 - x 2 + x 3 + 13 \end{array} \right.


and


{y1=(x22x3+4)/8y2=(3x1+x33x4+23)/11y3=(x2+x413)/10y4=(2x1x2+x3+13)/8\left\{ \begin{array}{c} y1 = (x2 - 2 x3 + 4)/8 \\ y2 = (3 x1 + x3 - 3 x4 + 23)/11 \\ y3 = (- x2 + x4 - 13)/10 \\ y4 = (- 2 x1 - x2 + x3 + 13)/8 \end{array} \right.


A faster way to get (3) is to solve the first equation in (2) for x1x1, the second equation for x2x2, the third for x3x3, the fourth for x4x4 and then rename the variables on the left as y1,y2,y3y1, y2, y3 and y4y4 respectively.

For k=0k = 0, take x(0)=(x1,x2,x3,x4)=(0,0,0,0)x^{(0)} = (x1, x2, x3, x4) = (0, 0, 0, 0), and compute

x(1)=(y1,y2,y3,y4)=(4/8,23/11,13/10,13/8)=(0.5,2.09,1.3,1.625)x^{(1)} = (y1, y2, y3, y4) = (4/8, 23/11, -13/10, 13/8) = (0.5, 2.09, -1.3, 1.625)

For k=1k = 1, use the entries in x(1)x^{(1)} as x1,x2,x3,x4x1, x2, x3, x4 in (3) and compute the new y1,y2,y3,y4y1, y2, y3, y4:


{y1=(2.092(1.3)+4)/8=1.086y2=(30.51.331.625+23)/11=1.666y3=(2.09+1.62513)/10=1.347y4=(20.52.091.3+13)/8=1.076\left\{ \begin{array}{c} y 1 = (2. 0 9 - 2 \cdot (- 1. 3) + 4) / 8 = 1. 0 8 6 \\ y 2 = (3 \cdot 0. 5 - 1. 3 - 3 \cdot 1. 6 2 5 + 2 3) / 1 1 = 1. 6 6 6 \\ y 3 = (- 2. 0 9 + 1. 6 2 5 - 1 3) / 1 0 = - 1. 3 4 7 \\ y 4 = (- 2 \cdot 0. 5 - 2. 0 9 - 1. 3 + 1 3) / 8 = 1. 0 7 6 \end{array} \right.


Thus x(2)=(1.086,1.666,1.347,1.076)x^{(2)} = (1.086, 1.666, -1.347, 1.076) . The entries in x(2)x^{(2)} are used on the right in (3) to compute the entries in x(3)x^{(3)} , and so on. Here are the results, with calculations using EXCEL and results reported to four decimal places:



if we decide to stop when the entries in x(k)x^{(k)} and x(k1)x^{(k-1)} differ by less than 0.001, then we need 8 iterations ( k=8k = 8 ).

Apply the Gauss-Seidel method to the system in Example 1 with x(0)=[0000]Tx^{(0)} = [0000]^T and 9 iterations.

For some kk , denote the entries in x(k)x^{(k)} by (x1,x2,x3,x4)(x1, x2, x3, x4) and the entries in x(k1)x^{(k-1)} by (y1,y2,y3,y4)(y1, y2, y3, y4) . The recursion


[800031100011002118][y1y2y3y4]=[0120001300010000][x1x2x3x4]+[4231313]\left[ \begin{array}{c c c c} 8 & 0 & 0 & 0 \\ - 3 & 1 1 & 0 & 0 \\ 0 & 1 & 1 0 & 0 \\ 2 & 1 & - 1 & 8 \end{array} \right] \left[ \begin{array}{c} y 1 \\ y 2 \\ y 3 \\ y 4 \end{array} \right] = \left[ \begin{array}{c c c c} 0 & 1 & - 2 & 0 \\ 0 & 0 & 1 & - 3 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right] \left[ \begin{array}{c} x 1 \\ x 2 \\ x 3 \\ x 4 \end{array} \right] + \left[ \begin{array}{c} 4 \\ 2 3 \\ - 1 3 \\ 1 3 \end{array} \right]


or


{8y1=x22x3+43y1+11y2=x33x4+23y2+10y3=x4132y1+y2y3+8y4=13\left\{ \begin{array}{c} 8 y 1 = x 2 - 2 x 3 + 4 \\ - 3 y 1 + 1 1 y 2 = x 3 - 3 x 4 + 2 3 \\ y 2 + 1 0 y 3 = x 4 - 1 3 \\ 2 y 1 + y 2 - y 3 + 8 y 4 = 1 3 \end{array} \right.


We will work with one equation at a time. When we reach the second equation, y1y1 is already known, so we can move it to the right side. Likewise, in the third equation y1y1 and y2y2 are known, so we move them to the right. Dividing by the coefficients of the terms remaining on the left, we obtain


y1=(x22x3+4)/8y 1 = (x 2 - 2 x 3 + 4) / 8y2=(3y1+x33x4+23)/11y 2 = (3 y 1 + x 3 - 3 x 4 + 2 3) / 1 1y3=(y2+x413)/10y 3 = (- y 2 + x 4 - 1 3) / 1 0y4=(2y1y2+y3+13)/8y 4 = (- 2 y 1 - y 2 + y 3 + 1 3) / 8


For k=0k = 0 , take x(0)=(x1,x2,x3,x4)=(0,0,0,0)x^{(0)} = (x1, x2, x3, x4) = (0, 0, 0, 0) , and compute


$y_{1} = 0.5 - 0\bullet (-0.125) - 0\bullet 0.25 - 0\bullet 0 = 0.5$ $y_{2} = 2.091 - 0.5\bullet (-0.273) - 0\bullet (-0.0909) - 0\bullet 0.273 = 2.227$ $y_{3} = -1.3 - 0.5\bullet 0 - 2.227\bullet 0.1 - 0\bullet (-0.1) = -1.523$ $y_{4} = 1.625 - 0.5\bullet 0.25 - 2.227\bullet 0.125 - (-1.523)\bullet (-0.125) = 1.031$ $\mathbf{x}^{(1)} = (\mathbf{y}1,\mathbf{y}2,\mathbf{y}3,\mathbf{y}4) = (0.5,2.227, - 1.523,1.031)$


The entries in x(1)x^{(1)} are used on the right in (4) to compute the entries in x(2)x^{(2)} , and so on. Here are the results, with calculations using EXCEL and results reported to four decimal places:



when kk is 5, the entries in x(k)x^{(k)} and x(k1)x^{(k-1)} differ by less than 0.001.

Answer: We need 8 iterations ( k=8k = 8 ) for Gauss Jacoboi's method and 5 iterations ( k=5k = 5 ) for Gauss-Seidel method. In this example the Gauss-Seidel method converges faster than Jacobi's method.

Answer provided by AssignmentExpert.com


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS