function rf=ruff(xp)

pr=xp(1);
rr=xp(2);

k=.4;
rt=2;
c=16;
s=c*pr^.5;
x0=23*rr^.33/pr^.33;
x=x0;
dx=1;
dg=0.1;
b=0;
while abs(dx)>1e-4,
   b=b+1;
   se=pr/exp(x*pr/s);
   sl=1/k/x;
   y=exp(x*pr/s)/k/pr;
   dx=y-x;
   x=x-dg*dx;
   if mod(b,100)==0
       [b x dx]
   end;
end;
rt=x/exp(k*s*(1-1/exp(x*pr/s)));

rf=x;

