function value = func(A,B)
global GROO beta bb;

%A = IN(1);
%B = IN(2);
C = -1.88354;

value = 0.;
for i=40:55
r1 = GROO(i,1);
r2 = r1*r1;
r6 = r2*r2*r2;
V(i-39) = A*exp(-B*r1)+C/r6; 
x(i-39) = r1;
y(i-39) = exp(-beta*V(i-39));
value = value+(GROO(i,2)/y(i-39))^2;
end;

value = log(value);

end;


