[Tutor] newton's method for system of nonlinear equations

2009-06-30 Thread kgotlelelok
Hi can someone help me with my program demostrating Newton's method for system of nonlinear equations below. Line 45 gives an error saying return is outside the function and I don't know how to rectify that. I neewd this program to print differnt values of x until the differnce between previous x a

[Tutor] newton's method for system of nonlinear equations

2009-06-26 Thread kgotlelelok
Hi, I am trying to write a program in python that solves a system of nonlinear equations using newton's method. I don't know what I am doing wrong. Please help from scipy import* x = array([0.0,0.0,0.0]) n=len(x) tol= 0.1 N=30 k=1 while k <= N: def f(x): f= zeros((len(x)),float)