Silaev/3.5.1 auto/fitting.py

11 lines
214 B
Python
Raw Normal View History

from scipy.optimize import curve_fit
from numpy import tanh
2022-12-18 14:15:09 +03:00
def probe(x, I_0, T_e, A):
return I_0 * tanh(x / T_e) + A * x
def fit(x, y):
params = curve_fit(probe, x, y, [50, 10, 1])[0]
return params