Dec-19-2017, 05:10 PM
Hallo all
I am processing data to use curve_fit and the the code program like this
import csv
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
def langmuir(x,a,b,c,d):
return np.exp(a*np.tanh((x+b)/c))+d;
popt, pcov = curve_fit(langmuir, Voltage, Current)
that code if I running that code is not error, I try to optimization with given some values, the code like this
popt, pcov = curve_fit(langmuir, Voltage, Current,bonds=(1,5,-5,0)),
if i running, the code will be error and the message error are
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scipy/optimize/minpack.py", line 736, in curve_fit
res = leastsq(func, p0, Dfun=jac, full_output=1, **kwargs)
have you any idea for fix that code ?
thank you very much
I am processing data to use curve_fit and the the code program like this
import csv
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
def langmuir(x,a,b,c,d):
return np.exp(a*np.tanh((x+b)/c))+d;
popt, pcov = curve_fit(langmuir, Voltage, Current)
that code if I running that code is not error, I try to optimization with given some values, the code like this
popt, pcov = curve_fit(langmuir, Voltage, Current,bonds=(1,5,-5,0)),
if i running, the code will be error and the message error are
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/scipy/optimize/minpack.py", line 736, in curve_fit
res = leastsq(func, p0, Dfun=jac, full_output=1, **kwargs)
have you any idea for fix that code ?
thank you very much