CHAPTER 04.08: GAUSS-SEIDEL METHOD: Example: Part 2 of 2

 

So we have iteration number 2. The initial guess . . . not the initial guess, I should say, the estimate which we have now for x1, x2, and x3 is given as follows, and that's from the previous iteration, that's what we got for the value of x1, x2, and x3.  And now we're going to again calculate our x1.  So x1 is 1, minus 3 x2, plus 5 x3, divided by 12. And so I'll get 1, minus 3 times x2, which is 4.9, plus 5 times 3.0923, divided by 12, and this number here turns out to be 0.14679. Same thing I'm going to do for x2. x2 will be, formula is 28, minus x1, minus 3 x3, divided by 5. So this turns out to be 28, minus x1, again you use the most recent value, the value here is 0.5, but we're going to use the most recent value for x1, which is 0.14679, minus 3 times x3, which is 3.0923, divided by 5, and this number here turns out to be 3.7153. We're going to do this same thing for x3. The formula for x3 which we wrote was 76, minus 3 x1, minus 7 x2, divided by 13. So this becomes 76, minus 3 times x1, so we're going to use the most recent value again here, is 0.14679, minus 7 times x2, again, we're going to use the most recent value which we obtained, which is 3.7153, divided by 13, and this number here turns out to be equal to 3.8118. So that's what we're getting as the value for x3. So what that means is that the . . . at the end of the second iteration, this is what we're getting the value for x1, x2, and x3. We are getting the value as 0.14679, 3.7153, and 3.8118, and that's what we're getting as our solution at the end of the second iteration.  Now what we're going to do is, again, we have to calculate the absolute relative approximate errors.  So, our new x1, x2, x3, which I just wrote just a little while ago, is 0.14679, 3.7153, and 3.8118, and the old guess will be the one which we obtained at the end of the first iteration, or these are the values we used when we started this iteration, 0.5, 4.9, and 3.0923. And if you go ahead and calculate the absolute relative approximate errors, this is what you're going to get.  I'm going to leave this as a homework exercise for you, you're going to get 240.61 percent, the absolute relative approximate error for x2 will turn out to be 31.889 percent, and the absolute relative approximate error for the third will be 18.874 percent. So again, these are basically calculated from the present guess and the previous guess. Now, if you're going to find the maximum of these absolute relative approximate errors, 240.61, 31.889, and 18.874, you are going to get 240.61 percent. So what you are finding out here is that at the end of the first iteration, this number, the maximum absolute relative approximate error was 100 percent, and now you're getting 240.61 percent.  So it might lead you do believe that this process is diverging, but that's not the case.  So if I go ahead and write down here, in a simple form, the iteration number and the maximum absolute relative approximate error, in percentage.  We already know that at the end of the first iteration, the maximum value was 100.  At 2, it is 240.6.  At 3, it turns out to be 80.23.  So it increased, but now it's decreasing, and all the way up to six, if I go up to six, the maximum value which I get for the relative approximate error is 0.743 percent.  So it does converge.  So it might start to diverge a little bit here, but eventually it's going to converge.  In fact, if you conduct more iterations, this number is going to get smaller and smaller.  At the end of the sixth iteration the value for x1, x2, and x3 which you get is 0.99919, 3.0001, and 4.0001.  This is what you get as the solution at the end of the sixth iteration for x1, x2, and x3.  And, in fact, the exact value, if you would calculate it by just using some programming language or computational package like MATLAB, or Mathcad, or Mathematica, or Maple, you will get 1, 3, and 4, and you can very well see that it's pretty close to what we're getting at the end of the sixth iteration. Of course, we can always calculate the relative, absolute relative true error to see that how close it is to quantify that error, but at the same time, you can see that if you conduct more iterations, you are going to get closer and closer to the exact value, so it does converge, although it might give you the impression that it's starting to diverge right there.  And that's the end of this segment.