如何在Python中将方程拟合到实验数据?
我有关于流体丝的直径 (D/D0) 如何随时间 (t) 变细的实验数据。 D/D0 (ydata) 和 t (xdata) 是 np 数组。
我想将数据拟合到以下方程:
在方程中,我已知的变量是 D/D1 = D/D0、D1=D0 和 t。
D/D0 = np.array([0.129 , 0.1613, 0.1935, 0.2258, 0.2581, 0.2903, 0.3226,0.3548, 0.3871, 0.4194, 0.4516, 0.4839, 0.5161, 0.5484, 0.5806, 0.6129, 0.6452, 0.6774, 0.7097, 0.7419, 0.7742, 0.8065, 0.8387, 0.871 , 0.9032, 0.9355, 1.])
t = np.array([0.7705, 0.7495, 0.5768, 0.5699, 0.503 , 0.493 , 0.4102, 0.3693, 0.3234, 0.2774, 0.2116, 0.2076, 0.1856, 0.1627, 0.1397, 0.1198, 0.0908, 0.0848, 0.0609, 0.0499, 0.0399, 0.0349, 0.0289, 0.02 , 0.012 , 0.007 , 0.002 ])
alpha、a、eta_0 和 lambda 对我来说是未知的,我想找到这些值并用我的实验数据绘制方程。
如何在 Python 中最好地实现这一目标?
I have experimental data on how diameter (D/D0) of a fluid filament thins over time (t). D/D0 (ydata) and t (xdata) are np arrays.
I would like to fit the data to the following equation:
In the equation, my known variables are D/D1 = D/D0, D1=D0, and t.
D/D0 = np.array([0.129 , 0.1613, 0.1935, 0.2258, 0.2581, 0.2903, 0.3226,0.3548, 0.3871, 0.4194, 0.4516, 0.4839, 0.5161, 0.5484, 0.5806, 0.6129, 0.6452, 0.6774, 0.7097, 0.7419, 0.7742, 0.8065, 0.8387, 0.871 , 0.9032, 0.9355, 1.])
t = np.array([0.7705, 0.7495, 0.5768, 0.5699, 0.503 , 0.493 , 0.4102, 0.3693, 0.3234, 0.2774, 0.2116, 0.2076, 0.1856, 0.1627, 0.1397, 0.1198, 0.0908, 0.0848, 0.0609, 0.0499, 0.0399, 0.0349, 0.0289, 0.02 , 0.012 , 0.007 , 0.002 ])
alpha, a, eta_0 and lambda are unknown to me and I would like to find these values and plot the equation with my experimental data.
How best can I achieve this in Python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在模型方程中仅用一个独立参数替换三个相关参数非常重要。然后就可以使用任何软件进行非线性回归。
It is important to replace the three dependent parameters by only one independent parameter into the model equation. Then one can use any software for non-linear regression.