[SciPy-User] [SciPy-user] Error using fmin
Hjalti Sigurjónsson
hjalti at vatnaskil.is
Wed Feb 22 08:49:34 EST 2012
Seems that z_den_s is not defined
In [20]: Traug(vO)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/hjalti/<ipython-input-20-8d295902530d> in <module>()
----> 1 Traug(vO)
/home/hjalti/<string> in Traug(v)
NameError: global name 'z_den_s' is not defined
-----Original Message-----
From: scipy-user-bounces at scipy.org [mailto:scipy-user-bounces at scipy.org] On Behalf Of RDX
Sent: 22. febrúar 2012 13:42
To: scipy-user at scipy.org
Subject: [SciPy-User] [SciPy-user] Error using fmin
I am using fmin and it returns initial guess as the final solution.
def Traug (v):
err=0
Traug_RHOB = v[0] + v[1]*(z_den_s/3125.0)**v[2]
count =arange(size(den_s))
for i in count:
err += abs(den_s[i] - Traug_RHOB [i])
return err
vO=[1.6, 0.5, 0.35]
t=fmin(Traug,vO )
a=t[0]; b=t[1]; c=t[2];
Code gives me a=1.6, b=0.5, c=0.35, which is my initial guess.
What is wrong? Many thanks in advance.
Regards,
Rishi
--
View this message in context: http://old.nabble.com/Error-using-fmin-tp33370870p33370870.html
Sent from the Scipy-User mailing list archive at Nabble.com.
_______________________________________________
SciPy-User mailing list
SciPy-User at scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
More information about the SciPy-User
mailing list