[General Information]

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


[Fitting Parameters]

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

[Independent Variables]

x = 


[Dependent Variables]

y = 


[Constants]


[Formula]

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

[Constraints]

[Parameters Initialization]
sort(x_y_curve);
//smooth(x_y_curve, 2);

double dXAsympt,dYAsympt;
int nRes = ocmath_xatasymt(x_data.GetSize(), x_data, y_data, &dXAsympt);
if(nRes != OE_NOERROR) dXAsympt = 1.0;
nRes = ocmath_yatasymt(x_data.GetSize(), x_data, y_data, &dYAsympt);
if(nRes != OE_NOERROR) dYAsympt = 1.0;

a=-1.0/dXAsympt;
c=a*dYAsympt;  	
x_y_curve = x_y_curve*(1+a*x_data);  	
double coeff[2];
fitpoly(x_y_curve,1,coeff);
b=coeff[0];

[Initializations]


[After fitting]


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