Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method?
if (x2 - x1)/x2 < err return end
Follow Math Help Forum on Facebook and Google+
Originally Posted by ilikec Code: if (x2 - x1)/x2 < err return end Is this terminating condition correct for newton raphson method? No, it at least needs an abs() on the left of the inequality. CB
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?
Originally Posted by ilikec 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? suppose err=0.0001 and fx(x)=-200 ? CB
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?
Originally Posted by ilikec 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? Yes CB
View Tag Cloud