0

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.

Vicknesh
  • 31
  • 1
  • 6
  • Please read http://stackoverflow.com/help/mcve; give us a clear description, including code, any useful input, and the result. "its not complaining" [sic] is not something we can solve. – Prune Sep 22 '15 at 21:19
  • added more commands. – Vicknesh Sep 23 '15 at 06:43

0 Answers0