[GENERAL INFORMATION]
Function Name=ExpDec1
Brief Description=Exponential Decay 1
Function Source=fgroup.ExpDec1
Function Type=Built-in
Function Form=Expression
Number Of Parameters=3
Number Of Independent Variables=1
Number Of Dependent Variables=1


[FITTING PARAMETERS]
Naming Method=User-Defined
Names=y0,A1,t1
Meanings=offset,amplitude,decay constant
Lower Bounds=--,0.0(X,OFF),0.0(X,OFF)
Upper Bounds=--,--,--
Number Of Significant Digits=


[FORMULA]
y = A1*exp(-x/t1) + y0


[CONSTRAINTS]



[CONSTANTS]


[Parameters Initialization]
sort( x_y_curve );
if(yatxmin(x_y_curve) < yatxmax(x_y_curve))
{
  y0 = max( y_data );
  x_y_curve = ln( y0 - x_y_curve );
  double coeff[2];
  fitpoly( x_y_curve, 1, coeff);  
  A1 = -exp( coeff[0] );
  t1 = -1.0 / coeff[1];
}
else
{ 
  y0 = min(y_data);
  x_y_curve = ln( x_y_curve - y0 );
  double coeff[2];
  fitpoly( x_y_curve, 1, coeff);  
  A1 = exp( coeff[0] );
  t1 = -1.0 / coeff[1];
}


[INITIALIZATIONS]



[AFTER FITTING]



[ON PARAM CHANGE]



[INDEPENDENT VARIABLES]
x=


[DEPENDENT VARIABLES]
y=


[CONTROLS]
General Linear Constraints=Off
Initialization Scripts=Off
Scripts After Fitting=Off
Number Of Duplicates=N/A
Duplicate Offset=N/A
Duplicate Unit=N/A
Generate Curves After Fitting=Yes
Curve Point Spacing=Uniform on X-Axis Scale
Generate Peaks After Fitting=Yes
Generate Peaks During Fitting=Yes
Generate Peaks with Baseline=Yes
Paste Parameters to Plot After Fitting=Yes
Paste Parameters to Notes Window After Fitting=Yes
Generate Residuals After Fitting=No
Keep Parameters=No


[COMPILE FUNCTION]
Compile=0
Compile Parameters Initialization=1


