[General Information]

Function Name=BlNeld	; name show up in the select function dialog
Brief Description=Bleasdale-Nelder Model
Function Type=Built-in		; source type, built-in, user-defined, external dll
Function Form=Expression	; function form;
Function Source=fgroup.BlNeld
Number Of Parameters=4
Number Of Independent Variables=1
Number Of Dependent Variables=1


[Fitting Parameters]

Naming Method=user-defined
Names=a,b,c,f
Lower bounds=--,--,--,--
Upper bounds=--,--,--,--
Meanings=coefficient,coefficient,coefficient,power

[Independent Variables]

x =


[Dependent Variables]

y =


[Constants]


[Formula]

y = (a + b*x^f)^(-1/c)

[Constraints]

[Parameters Initialization]
sort(x_y_curve);
smooth(x_y_curve);
Dataset xd;
x_y_curve.AttachX(xd);
double yatxmaxmin=min(yatxmin(x_y_curve),yatxmax(x_y_curve));
f=(min(x_y_curve)+1e-5 < yatxmaxmin)? -1:1;
// k1=a/b=
double k1=(f>0)? -xatasymt(x_y_curve) : -1.0/xatasymt(x_y_curve);
x_y_curve = -ln(x_y_curve);
if(k1>0)
	xd=ln(k1+xd);
else
	xd=ln(k1+1/xd);
double coeff[2];
fitpoly(x_y_curve,1,coeff);
c=1/coeff[1];
b=exp(c*coeff[0]);
a=k1*b;

[Initializations]


[After fitting]


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

