I am having datas in.csv file and it contains 2 column x and y axis. The axis are readed from .csv file and then fitting the datas with stretched exponential function but its showing error. Please solve the error.
My function is f(x) = a. exp (-b.t) ^ c + d. (Stretched exponential fitting)
and my coding is,
# Reading datas from file
data = np.genfromtxt('filename.csv', delimiter=',', skiprows=5)
x=data[:, 0]
y=data[:, 1]
# Fitting Streched Exponential Decay Curve
smoothx = np.linspace(x[0], x[-1], (5*x[-1]))
guess_a, guess_b, guess_c, guess_d = 4000, -0.005, 4, 4000
guess = [guess_a, guess_b, guess_c, guess_d]
f_theory1 = lambda t, a, b, c, d: a * np.exp((b*t)^(c)) + d
p, cov = curve_fit(f_theory1, x, y, p0=np.array(guess))
f_fit1 = lambda t: p[0] * np.exp((p[1] * t)^((p[2]))) + p[3]
plt.show()
Here i am showing only guess and fitting part of my program.
Kindly correct mistakes in my code. Thanks in advance.