title: Error in Scipy curve fit for more than two parameters
body: <p>I am quite new to Scipy. I have a data file (<a href="https://www.dropbox.com/s/mwz8s2kap2mnwo0/data.dat?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/mwz8s2kap2mnwo0/data.dat?dl=0</a>) and want to fit the function a<em>exp(b</em>x^c). The problem is when I give manually the value of c (say c = 0.75), the code works perfectly, but if I want to find the 'a', 'b' and 'c' from the fit, the code does not work and producing a flat line. Sorry if the problem is too silly. The code reads as:</p>
  
  <pre><code>import numpy as np
  from scipy.optimize import curve_fit
  import sys
  import matplotlib.pyplot as plt
  import math as math
  
  filename = sys.argv[1]
  
  data = np.loadtxt(filename)
  
  x = np.array(data[:,0])
  y = np.array(data[:,1])
  
  def func(x, a, b, c):
      return a*np.exp(b*x**c)
  
  params = curve_fit(func, x, y)
  
  [a, b, c] = params[0]
  
  perr = np.sqrt(np.diag(params[1]))
  
  x_new = []
  y_new = []
  
  for i in np.linspace(1.00003e-05, 0.10303175629999914, num=1000):
      j = func(i, a, b, c)
      x_new.append(i)
      y_new.append(j)
  
  x1 = np.array(x_new)
  y1 = np.array(y_new)
  
  print ("a = ", a, "error = ", perr[0], "error % = ", (perr[0]/a)*100, '\t' "b = ", b, "error = ", perr[1], "error % = ", (perr[1]/b)*100), '\t' "c = ", c, "error = ", perr[2], "error % = ", (perr[2]/c)*100,
  
  #np.savetxt('fit.dat', np.c_[x1, y1])
  
  plt.plot(x, y, label='data')
  plt.plot(x1, y1, label = 'a*np.exp(b*x**c)')
  plt.xlabel('Time(s)')
  plt.ylabel('SRO')
  plt.legend()
  plt.show()
  </code></pre>