13 lines
425 B
Python
13 lines
425 B
Python
from scipy.optimize import curve_fit
|
||
from numpy import tanh
|
||
|
||
|
||
# Обсчет значений на данный момент недоступен, но может быть вызван в другом файле
|
||
# с использованием функции fit()
|
||
def probe(x, I_0, k_0, A):
|
||
return I_0 * tanh(k_0 / I_0 * x) + A * x
|
||
|
||
|
||
def fit(x, y):
|
||
params = curve_fit(probe, x, y, [50, 10, 1])[0]
|
||
return params |