<!--

function solve(form){


D = eval(form.D.value)*Math.pow(10,-3);
L = eval(form.L.value)*Math.pow(10,-3);
dR = eval(form.dD.value)*Math.pow(10,-6)/2;
omega = eval(form.n.value)*2*Math.PI/60;
vis = eval(form.vis.value);
h0 = eval(form.h0.value)*Math.pow(10,-6);
rho = eval(form.rho.value)*Math.pow(10,3);
c = eval(form.c.value)*Math.pow(10,3);

if (D != 0.040 || dR != 20*Math.pow(10,-6) || h0 != 3*Math.pow(10,-6)) {
alert("Please login to get full access!");
D=0.040; form.D.value = D*Math.pow(10,3);
dR=20*Math.pow(10,-6); form.dD.value = 2*dR*Math.pow(10,6);
h0=3*Math.pow(10,-6); form.h0.value = h0*Math.pow(10,6);
}

R = D/2;
dR_R=dR/R;
L_D=L/D;
eps = (dR-h0)/dR;

gamma =Math.sqrt(1-eps*eps);
fro=-12*eps*eps/((2+eps*eps)*gamma*gamma);
fto=6*Math.PI*eps/((2+eps*eps)*gamma);
fo=Math.sqrt(fro*fro+fto*fto);

lambdas = Math.sqrt((2+eps*eps)/(2*gamma*gamma));
lambdam = Math.sqrt((2*(2+eps*eps)*(1+gamma))/(4*gamma*gamma+4*gamma-gamma*eps*eps));

lambdat=(lambdas-lambdam)*Math.exp(-L_D)+lambdam;
lambdar=Math.sqrt(2)*((lambdas-lambdam)*Math.exp(-L_D)+lambdam);

x=lambdar*L_D;
tanhxr=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
x=lambdat*L_D;
tanhxt=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
Zr=1-tanhxr/(lambdar*L_D);
Zt=1-tanhxt/(lambdat*L_D);
fr=Zr*fro;
ft=Zt*fto;
So=Math.sqrt(fr*fr+ft*ft);
betha=Math.atan(-ft/fr)*180/Math.PI;

cmu=2*Math.PI/(So*Math.sqrt(1-eps*eps))+eps*Math.sin(betha)/2;

lambdae = 1-Math.exp(-2*L_D);
x=lambdae*L_D;
tanhxe=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
Ze=1-tanhxe/(lambdae*L_D);

x=lambdam*L_D;
tanhxm=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
Zm=1-tanhxm/(lambdam*L_D);

Cqe=Math.PI*(1+eps)-(Math.PI)*eps*Ze*(eps+1)*(eps+2)/(2+eps*eps);
Cqm=Math.PI*(1-eps)+(Math.PI)*eps*Zm*(eps-1)*(eps-2)/(2+eps*eps);
Cq = (Cqe-Cqm)/(2*Math.PI);

F_1 = So*vis*omega*L*R/(dR_R*dR_R);
eps_1=eps;

form.L_D.value = Math.round(L_D*100)/100;
form.R_dR.value = Math.round(R/dR);
form.eps_1.value = Math.round(eps_1*1000)/1000;
form.So.value = Math.round(So*1000)/1000;
form.betha.value = Math.round(betha*10)/10;
form.Cq.value = Math.round(Cq*1000)/1000;
form.cmu.value = Math.round(cmu*1000)/1000;
form.mu.value = Math.round(cmu*dR_R*10000)/10000;

form.F_1.value = Math.round(F_1*Math.pow(10,-3)*1000)/1000;

Q = Cq*omega*L_D*2*R*R*dR;
N = cmu*dR_R*F_1*omega*R
dT = N/(Q*rho*c);

form.Q.value = Math.round(Q*Math.pow(10,6)*1000)/1000;
form.N.value = Math.round(N*10)/10;
form.dT.value = Math.round(dT*10)/10;


eps_2=1.001*eps_1
eps=eps_2

gamma =Math.sqrt(1-eps*eps);
fro=-12*eps*eps/((2+eps*eps)*gamma*gamma);
fto=6*Math.PI*eps/((2+eps*eps)*gamma);
fo=Math.sqrt(fro*fro+fto*fto);

lambdas = Math.sqrt((2+eps*eps)/(2*gamma*gamma));
lambdam = Math.sqrt((2*(2+eps*eps)*(1+gamma))/(4*gamma*gamma+4*gamma-gamma*eps*eps));

lambdat=(lambdas-lambdam)*Math.exp(-L_D)+lambdam;
lambdar=Math.sqrt(2)*((lambdas-lambdam)*Math.exp(-L_D)+lambdam);

x=lambdar*L_D;
tanhxr=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
x=lambdat*L_D;
tanhxt=(Math.exp(x)-Math.exp(-x))/(Math.exp(x)+Math.exp(-x));
Zr=1-tanhxr/(lambdar*L_D);
Zt=1-tanhxt/(lambdat*L_D);
fr=Zr*fro;
ft=Zt*fto;
So=Math.sqrt(fr*fr+ft*ft);
betha=Math.atan(-ft/fr)*180/Math.PI;

F_2 = So*vis*omega*L*R/(dR_R*dR_R);

e1 = dR*eps_1;
e2 = dR*eps_2;
dh = e2-e1;

dF_dh = (F_2-F_1)/dh;
dF_dhy = (F_2-F_1)/(dh*Math.cos(betha*Math.PI/180));

FR = F_2;
Fx = Math.sqrt(FR*FR-F_1*F_1);
dbetha = Math.atan(Fx/F_1);
dhx = dh*Math.sin(betha*Math.PI/180+dbetha);
dF_dhx = Fx/dhx;

form.dF_dh.value = Math.round(dF_dh/Math.pow(10,6));

} 

function reset(form){}
// -->

