[General Information]
Function Name = BoltzIV
Brief Description = Transformed Boltzmann function for IV data
Function Source = fgroup.BoltzIV
Function Type = Built-in
Function Form = Expression
Number Of Parameters = 4
Number Of Independent Variables = 1
Number Of Dependent Variables = 1
Analytical Derivatives for User-Defined = 0
FunctionPrev = BoltzFromIV


[Fitting Parameters]
Naming Method = User-Defined
Names = vhalf,dx,gmax,vrev
Meanings = center,time const, gmax, vrev
Lower Bounds=--(I,Off),--(X,Off),--(I,Off),(I,Off)
Upper Bounds=--(I,Off),--(I,Off),--(I,Off),--(I,Off)
Number Of Significant Digits = 


[Formula]
y=((x-vrev)*gmax)/(1+exp((x-vhalf)/dx))





[Constraints]






[Parameters Initialization]
sort(x_y_curve);
//vhalf = xaty50( x_y_curve );
//if( yatxmin( x_y_curve ) > yatxmax( x_y_curve ) )
//{
//  gmax = min( y_data );
//}
//else
//{
//  gmax = max( y_data );
//}

vector roots;
BOOL bHasRoot = find_roots(x_data, y_data, roots) > 0;

double xmin, xmax;
x_data.GetMinMax(xmin, xmax);
dx = (xmax - xmin) / 20.0;

int size = x_data.GetSize();
if( y_data[size*0.5] < (y_data[0] + y_data[size-1])*0.5 )
{
	vrev = bHasRoot ? roots[roots.GetSize()-1] : x_data[0];
	vhalf = xatymin( x_y_curve );
	dx *= -1;
}
else
{
	vrev = bHasRoot ? roots[0] : x_data[size-1];
	vhalf = xatymax( x_y_curve );
}

if( fabs(y_data[size/2] - vrev ) > 1E-8 )
	gmax = y_data[size/2]*(1+exp((x_data[size/2]-vhalf)/dx))/(x_data[size/2]-vrev);
else
	gmax = y_data[0]*(1+exp((x_data[0]-vhalf)/dx))/(x_data[0]-vrev);	



[Initializations]









[After Fitting]
/*Code to be executed after fitting, a good place for generating results.*/









[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


[References]
Favre, I., E. Moczydlowsky, and L. Schild. 1995. Specificity for block by
saxitoxin and divalent cations at a residue which determines the sensitivity
of sodium channel subtypes to guanidinium toxins. 
J. Gen.Physiol. 106:203-229.

Iustin V. Tabarean,Peter JurankaandCatherine E. Morris, Membrane Stretch 
Affects Gating Modes of a Skeletal Muscle Sodium Channel. 
Biophys J. 1999 August; 77(2):758-774.