用scipy查找曲线参数

问题描述

大家好,我正在使用 scipy 优化曲线拟合来为我的数据找到最佳曲线。我使用的数据和函数

X = [231.,845.,275.,935.9,927.6,803.,707.,890.,934.3,939.1,931.7,613.,925.,822.2,913.,899.7,1. ]
Y = [12.4,11,12.3,2.6,9,11.5,12,10.5,3.9,0.7,5,6.5,11.4,10,9.6,12.5]

def IV(x,a,b):
    return a*np.exp(b*x)

params,params_covariance = optimize.curve_fit(IV,X,Y)
a = params[0]
b = params[1]

但我得到两个错误

<ipython-input-6-c32b0762eb3a>:6: RuntimeWarning: overflow encountered in exp
  return a*np.exp(b*x)

RuntimeError: Optimal parameters not found: Number of calls to function has reached maxfev = 600.

现在我正在尝试使用 maxfev = 1000000000,但它需要很长时间。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)