title: Curve Fitting in Python not fitting my curve
body: <p>I am currently doing a curve fit on some data to be input. My function is (where Ti is initial hot temp Ta is cold temp and c is the half life):</p>
  
  <pre><code>def extract_parameters(Ts, ts):
      def model(t, Ti, Ta, c):
          return (Ti - Ta)*math.e**(-t / c) + Ta
      popt, pcov = cf(model, ts, Ts, p0 = (10, 7, 6))
      Ti, Ta, c = popt
      xfine = np.linspace(0, 10, 101)
      yfitted = model(xfine, *popt)
      pl.plot(Ts, ts, 'o', label = 'data point')
      pl.plot(xfine, yfitted, label = 'fit')
      pylab.legend()
      pylab.show() 
  </code></pre>
  
  <p>When I enter:</p>
  
  <pre><code>extract_parameters(np.array([1,2,3,4,5,6,7,8,9,10]), np.array([10.0,9.0,8.5,8.0,7.5,7.3,7.0,6.8,6.6,6.3]))
  </code></pre>
  
  <p>My graph starts to fit right at the end but while my data starts at 10 my curve starts at about 240 and then sweeps down, which is not what I want. I thought setting <code>p0</code> would help but it doesn't appear to help at all.</p>
  
  <p><img src="https://i.stack.imgur.com/6gH4c.png" alt="example of failed fit"></p>