Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

My teacher has a problem that asks me to iterate on Gauss-Seidel equations considering a maximum variation of 0.01. This means making the first iteration and get check if the max of each error is less that 1%?

err(x1) = (actual-guess)/actual = 100%
err(x2) = 100%
err = max(err(x1), err(x2))

Need another iteration because the err > than requested. Is this what it really means?

thanks

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Don't think so. In real life, you never know what the true answer to your problem is (call it $x^*$ for convenience). In practice, you use deviation from the previous iterate as a stopping criterion. So instead of computing error as $|x_n - x^*|$, use $|x_n - x_{n-1}|$.

share|improve this answer
    
isn't the guess=x_n-1; and actual=x_n in my example? The difference is that in yours you don't divide by the actual=x_n –  Totty Feb 21 '13 at 9:02
    
@Totty depending on the problem, you may want to use absolute error calculation (as in my answer) or relative error calculation (as you are suggesting, $|1 - x_n/x_{n-1}|$). Both are measures of how far the last step moved away from the previous one. The idea is, when convergence happens, iteration step size decreases... –  gt6989b Feb 21 '13 at 15:27
    
but how do you find the real value? with another method? –  Totty Feb 21 '13 at 20:11
    
@Totty You don't :). You never know what the real value is, otherwise why would you be engaged in a numerical procedure in the first place? –  gt6989b Feb 21 '13 at 20:51
    
then how do you have the absolute error? From what I know absolute error is referred to the real value.. –  Totty Feb 22 '13 at 17:32
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.