title: Fitting curve: why small numbers are better?
body: <p>I spent some time these days on a problem. I have a set of data:</p>
  
  <p>y = f(t), where y is very small concentration (10^-7), and t is in second. t varies from 0 to around 12000.</p>
  
  <p>The measurements follow an established model:</p>
  
  <pre><code>y = Vs * t - ((Vs - Vi) * (1 - np.exp(-k * t)) / k)
  </code></pre>
  
  <p>And I need to find Vs, Vi, and k. So I used curve_fit, which returns the best fitting parameters, and I plotted the curve.</p>
  
  <p>And then I used a similar model:</p>
  
  <pre><code>y = (Vs * t/3600 - ((Vs - Vi) * (1 - np.exp(-k * t/3600)) / k)) * 10**7
  </code></pre>
  
  <p>By doing that, t is a number of hour, and y is a number between 0 and about 10. The parameters returned are of course different. But when I plot each curve, here is what I get:</p>
  
  <p><a href="http://i.imgur.com/XLa4LtL.png" rel="noreferrer">http://i.imgur.com/XLa4LtL.png</a></p>
  
  <p>The green fit is the first model, the blue one with the "normalized" model. And the red dots are the experimental values.</p>
  
  <p>The fitting curves are different. I think it's not expected, and I don't understand why. Are the calculations more accurate if the numbers are "reasonnable" ?</p>