[General Information]
Function Name = DoubleBoltzmann
Brief Description = Double Boltzmann Function
Function Source = fgroup.DoubleBoltzmann
Number Of Parameters = 7
Function Type = Built-in
Function Form = Equations
Number Of Independent Variables = 1
Number Of Dependent Variables = 1


[Fitting Parameters]
Naming Method=User-Defined
Names = y0,A,frac,x01,x02,k1,k2
Initial Values = --(V)
Meanings = Offset,Span,Fraction,Center,Center,Slope factor,Slope factor
Lower Bounds = --(X, OFF),--(X, OFF),0.0(X, ON),--(X, OFF),--(X, OFF),--(X, OFF),--(X, OFF)
Upper Bounds = --(X, OFF),--(X, OFF),1.0(X, ON),--(X, OFF),--(X, OFF),--(X, OFF),--(X, OFF)
Number Of Significant Digits = 


[Independent Variables]
x = 


[Dependent Variables]
y = 


[Formula]
y = y0 + A * ( frac / ( 1 + exp((x-x01)/k1) ) + ( 1-frac ) / ( 1 + exp((x-x02)/k2) ) );



[Initializations]




[After Fitting]



[Controls]
General Linear Constraints = 0
Initialization Scripts = 0
Scripts After Fitting = 0
Number Of Duplicates = N/A
Duplicate Offset = N/A
Duplicate Unit = N/A
Generate Curves After Fitting = 1
Curve Point Spacing = Uniform on X-Axis Scale
Generate Peaks After Fitting = 1
Generate Peaks During Fitting = 1
Generate Peaks with Baseline = 1
Paste Parameters to Plot After Fitting = 1
Paste Parameters to Notes Window After Fitting = 1
Generate Residuals After Fitting = 0
Keep Parameters = 0
Compile On Param Change Script = 1
Enable Parameters Initialization = 1


[Compile Function]
Compile = 1
Compile Parameters Initialization = 1.
OnParamChangeScriptsEnabled = 0.


[Parameters Initialization]
sort(x_y_curve);
A = max( y_data ) - min( x_data );
int n = y_data.GetSize()/2;
vector vX, vY;
vX.SetSize(n);
vY.SetSize(n);
for(int i = 0; i < n; i++)
{
vX[i] = x_data[i];
vY[i] = y_data[i];
}
Curve crv1( vX, vY );
x01 = xaty50( crv1 );
for(i = n; i < 2*n; i++)
{
vX[i-n] = x_data[i];
vY[i-n] = y_data[i];
}
Curve crv2( vX, vY );
x02 = xaty50( crv2 );
double xmin, xmax;
x_data.GetMinMax(xmin, xmax);
double range = xmax - xmin;
if ( yatxmax(x_y_curve) - yatxmin(x_y_curve) > 0)
k1 = -5.0 / range;
else
k1 = 5.0 / range;
k2 = k1;
frac = 0.5;



[Constraints]



[Derived Parameters]
A1 = A*frac
A2 = A*(1-frac)
