0

I have not been able to find a good answer to this.
I have x,y datapoints that should fit this double exponential function:

def function(A,B,x,C): y = np.exp(-ACnp.exp(-B*x)) return y

data usually looks similar to this:

x=[0.375,1.225,2.075,2.925,3.775,4.625,5.475,6.325,7.175,8.025,8.875,9.725,10.575,11.425,12.275,13.125,13.975,14.825]

y=[0.016951205,0.081607943,0.186947572,0.507083182,0.759171813,0.908342414,0.988013077,0.954594987,1.029664608,0.947088025,1.05945027,1.119021673,1.119021673,0.939823223,0.924324979,1.006417242,0.985349316,0.9272309]

y_error=[0.002,0.007,0.016,0.044,0.067,0.08,0.087,0.084,0.09,0.083,0.093,0.098,0.098,0.082,0.081,0.088,0.086,0.081]

the value of C is known: C = 1

I`d like to fit the curve and find out the values of A and B for the fit. Any help is apreciated, Thanks!

  • https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html – mcsoini Oct 28 '21 at 08:34
  • What if you calculate `log(log)` of y values. Like: `new_ys = np.log(np.log(ys))`. `xs` and `new_ys ` values will have a linear relation. Do a linear fit then use thoes values to calculate the real fit. See: https://stackoverflow.com/a/3433503/2681662 – MSH Oct 28 '21 at 09:13
  • This seems very simple in the general case. But difficulty might occur in some particular cases of data. In order to check with your kind of data, edit (or joint) a representative numerical example of data in your question. – JJacquelin Nov 01 '21 at 16:43

0 Answers0