[SciPy-User] Fwd: using curve_fit with a fixed parameter

Alexandre Furlan alexandrepfurlan at gmail.com
Fri Nov 4 13:13:26 EDT 2016


---------- Forwarded message ----------
From: Alexandre Furlan <alexandrepfurlan at gmail.com>
Date: 2016-11-04 14:59 GMT-02:00
Subject: using curve_fit with a fixed parameter
To: scipy-user at scipy.org


Hi all,

I need to make a least square method of a model function, but a parameter
of my
model function is fixed (I don't change it). I my case, I have :

def func(i,rij,eps,sigma) :

where, i is similar "x", rij is a array used to obtain some parameters of
the function, and
eps and sigma are parameter that I want to optimize. I order to optimize
these parameters I'm doing :

for i in arange(len(rij)/natoms) :
    popt,pcov = curve_fit(LJ(i,rij,eps,sigma), x,Ek)

where x = x[i] and Ek[i]. When make it, I have :

TypeError('{!r} is not a Python function'.format(func))
TypeError: -0.019566048015813797 is not a Python function

Do you known how to do this type of optmization using curve_fit ?

many thanks for all

Best

Alexandre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20161104/99e0448a/attachment.html>


More information about the SciPy-User mailing list