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

2009-06-30 Thread Luke Paireepinart
kgotlele...@galmail.co.za wrote: 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 That's because you have a return outside of a function. for k in range(n-1,-1,-1): b

[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

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

2009-06-26 Thread Skipper Seabold
On Fri, Jun 26, 2009 at 6:54 AM, wrote: > 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

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

2009-06-26 Thread Dave Angel
kgotlele...@galmail.co.za wrote: 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 First thing wrong is posting two messages in the mailing list in rapid succession (7 minutes) wit

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

2009-06-26 Thread A.T.Hofkamp
kgotlele...@galmail.co.za wrote: 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 In general, it helps for both you and us if you show what happens when you run the program, and how

[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)