[General Information]

Function Name=ExpDec2	; name show up in the select function dialog
Brief Description=Exponential Decay 2
Function Type=Built-in		; source type, built-in, user-defined, external dll
Function Form=Expression	; function form;
Function Source=fgroup.ExpDec2
Number Of Parameters=5
Number Of Independent Variables=1
Number Of Dependent Variables=1


[Fitting Parameters]

Naming Method=user-defined
Names=y0,A1,t1,A2,t2
Lower bounds=--,0.0(X,OFF),0.0(X,OFF),0.0(X,OFF),0.0(X,OFF)
Upper bounds=--,--,--,--,--
Meanings=offset,amplitude,decay constant,amplitude,decay constant


[Independent Variables]

x = 


[Dependent Variables]

y = 


[Constants]


[Formula]
y = A1*exp(-x/t1) + A2*exp(-x/t2) + y0

[Constraints]


[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=A2=-exp(coeff[0])/2.0;
   t1=t2=-1.0/coeff[1]; 	
}
else
{
   y0 = yatasymt(x_y_curve);
   x_y_curve = ln(x_y_curve - y0);
   double coeff[2];
   fitpoly(x_y_curve,1,coeff);
   A1=A2=exp(coeff[0])/2.0;
   t1=t2=-1.0/coeff[1]; 	
}
[Initializations]


[After fitting]


[Controls]
General Linear Constraints=Off
Initialization scripts=Off
Scripts After fitting=Off

