洛伦兹安装不够好
洛伦兹情节拟合的合适问题。在OriginPro上,它非常合适。
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from lmfit.models import LorentzianModel
import numpy as np
datas = pd.read_csv('pg60_02_0.5V.csv')
a = datas.to_numpy()
a = a.transpose()
x= a[0]
y= a[1]
model = LorentzianModel()
pars = model.guess(y, x=x)
out = model.fit(y, pars, x=x)
print(out.fit_report())
plt.plot(x, y)
plt.plot(x, out.best_fit, '-', label='best fit')
plt.legend()
plt.show()
这是 plot 。
The fitting issue with the Lorentzian plot fitting. On originpro it is fitting good.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from lmfit.models import LorentzianModel
import numpy as np
datas = pd.read_csv('pg60_02_0.5V.csv')
a = datas.to_numpy()
a = a.transpose()
x= a[0]
y= a[1]
model = LorentzianModel()
pars = model.guess(y, x=x)
out = model.fit(y, pars, x=x)
print(out.fit_report())
plt.plot(x, y)
plt.plot(x, out.best_fit, '-', label='best fit')
plt.legend()
plt.show()
Here is the Plot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论