klegodi at csir.co.za
Fri Jun 26 12:47:29 CEST 2009
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])
while k <= N:
f[k]= x[k]**2 + x[k]-37
f[k]=x[k]- x[k]**2- 5
f[k]= x[k] + x[k]+ x[k]- 3
for i in range(n):
y[k] = -(J.I)*f[k]
if sqrt(dot(f0,f0)/len(x)) < tol: print x
print 'Too many iterations'
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor