from scipy.optimize import curve_fit
from numpy import tanh


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