title: Non-linear fit in Python 2.7 doesn't give any good result
body: <p>Here is my problem: I have experimental data to fit with a model. To do this, i used curve_fit from scipy. The script goes without any error or warning, but doesn't give a satisfying result (it gives me a quasi line instead of two Lorentzian shaped graph).</p>
  <p>But the strangest part is that when I give a guessing array to the fitting function, none of the guessed parameters is modified, except for the third one (nevertheless it stay far from the expected value). However I pay attention to the order of the guessed parameters.</p>
  <p>I give you the part of the code that does the fit.</p>
  <pre><code>X = 927.
  Z = 88.
  M = 5.e-15
  O1 = 92975.
  O2 = 93570.
  bm = np.arctan2(Z,X)
  P0 = 0.
  T = np.pi/2.
  TM = np.pi/3.
  G = 20.
  
  File =&quot;Data.txt&quot;
  open(File,  &quot;rb&quot;)
  dat = np.loadtxt(File)
  
  O = dat[:,1]
  
  D = np.sqrt(1./20. *10**(dat[:,7]/10.)*1/((X**2+Z**2)*10**(6)))
  
  def model(W,o1,o2,p0,t,tm,g):
  
      DB = np.abs((1./M)*(np.cos(bm-tm)*(p0*np.cos(t-tm)/(o1**2-W**2-1.j*g*W))+np.sin(bm-tm)*(p0*np.sin(t-tm)/((o2**2-W**2-1.j*g*W)))))
  
      return DB
  
  guess = np.array([O1,O2,P0,T,TM,G])
  fit , pcov = curve_fit(model, O , D , guess)
  </code></pre>
  <p>I search an research during a complete month to find any error, but still noting. Is It possible that the function is to complex for curve_fit?</p>
  <p>Thank you in advance for your help. Don't hesitate if you need further informations or data</p>
  <p>Here is a plot of <code>O</code> v <code>D</code>. The red points are the experiment and the blue line is the function with the returned fit parameters (not modified, so they are the guessing values)</p>
  <p><a href="https://i.stack.imgur.com/lBJSE.png" rel="nofollow noreferrer"><code>D = model(O)</code></a></p>
  <p><a href="https://i.stack.imgur.com/lBJSE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lBJSE.png" alt="enter image description here" /></a></p>