I ilikec May 2010 39 0 May 27, 2010 #1 Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method?

Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method?

C CaptainBlack MHF Hall of Fame Nov 2005 14,972 5,271 someplace May 27, 2010 #2 ilikec said: Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method? Click to expand... No, it at least needs an abs() on the left of the inequality. CB

ilikec said: Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method? Click to expand... No, it at least needs an abs() on the left of the inequality. CB

I ilikec May 2010 39 0 May 27, 2010 #3 cant i say if feval(fx,x) < err return end fx is the function x is the value of x at current iteration So fx(x) < err means x is very close to the root Am i correct in this case?

cant i say if feval(fx,x) < err return end fx is the function x is the value of x at current iteration So fx(x) < err means x is very close to the root Am i correct in this case?

C CaptainBlack MHF Hall of Fame Nov 2005 14,972 5,271 someplace May 27, 2010 #4 ilikec said: cant i say if feval(fx,x) < err return end fx is the function x is the value of x at current iteration So fx(x) < err means x is very close to the root Am i correct in this case? Click to expand... suppose err=0.0001 and fx(x)=-200 ? CB

ilikec said: cant i say if feval(fx,x) < err return end fx is the function x is the value of x at current iteration So fx(x) < err means x is very close to the root Am i correct in this case? Click to expand... suppose err=0.0001 and fx(x)=-200 ? CB

I ilikec May 2010 39 0 May 27, 2010 #5 oh yeah i forgot it should be abs(f(x) ) < err absolute value so -200 will be 200 in this case is it okay to use this technique?

oh yeah i forgot it should be abs(f(x) ) < err absolute value so -200 will be 200 in this case is it okay to use this technique?

C CaptainBlack MHF Hall of Fame Nov 2005 14,972 5,271 someplace May 27, 2010 #6 ilikec said: oh yeah i forgot it should be abs(f(x) ) < err absolute value so -200 will be 200 in this case is it okay to use this technique? Click to expand... Yes CB

ilikec said: oh yeah i forgot it should be abs(f(x) ) < err absolute value so -200 will be 200 in this case is it okay to use this technique? Click to expand... Yes CB