We found the problem may be caused by the integral function itself. When the integral function’s value is 1/0, the integral value may overflow. I noticed your integral function in “FitFuncs.c” is:
----------------------------------------------------------------------
return x * (x-alpha * intensity /beta) * exp(-factor*pow(x,0.66)/(8.617E-5*temp))/(x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time));
----------------------------------------------------------------------
The denominator part: (x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time)) may be zero. To avoid the overflow, you can change your code as follows.
----------------------------------------------------------------------
double dd = x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time);
if ( fabs(dd) < 1e-12 && dd >= 0 )
dd = 1e-12;
else if ( fabs(dd) < 1e-12 && dd < 0 )
dd = -1.0e-12;
return x * (x-alpha * intensity /beta) * exp(-factor*pow(x,0.66)/(8.617E-5*temp)) / dd;
----------------------------------------------------------------------
Sam
OriginLab Technical Services