import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-18.1 Page No.399\n');
##Torque
Dp=(1.5+1.208)/2.;
F=5800.;
L=1/3.;
f=0.15;
Tup=(F*Dp/4.)*(L+math.pi*f*Dp)/(math.pi*Dp-f*L);
print'%s %.2f %s '%('\n Torque up = ',Tup,' in-lb.');
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-18.2 Page No.400\n');
##Lead angle
L=1/3.;
Dp=1.354;
LA=math.atan(L/(math.pi*Dp));
print'%s %.2f %s '%('\n Lead angle = ',LA*180/math.pi,'deg');
##Efficiency
f=0.15;
e=math.tan(LA)*(1-f*math.tan(LA))/(math.tan(LA)+f);
print'%s %.2f %s '%('\n Efficiency = ',e*100,'');
##Power
n=175.;
T=454.;
P=T*n/63000.;
Pt=P*2.;
print'%s %.2f %s '%('\n Power = ',P,' hp per lead screw.');
if f>math.tan(LA):
print('\n It is self-locking');
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-18.3 Page No.402\n');
L=1/4.;
Dp=1.375;
LA=math.atan(L/(math.pi*Dp));
print'%s %.2f %s '%('\n Lead angle = .',LA*180./math.pi,'deg');
##Torque
phi=14.5*math.pi/180.;
f=0.15;
F=5800.;
Tup=(F*Dp/4.)*(math.cos(phi)*math.tan(LA)+f)/(math.cos(phi)-f*math.tan(LA));
print'%s %.2f %s '%('\n Torque = ',Tup,' in-lb.');
##Power
n=175.*4./3.;
P=Tup*n/63000.;
print'%s %.2f %s '%('\n Power = ',P,' hp per lead screw.')
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-18.4 Page No.405\n');
##Torque
L=0.5;
F=5800./2.;
T=0.177*F*L;
print'%s %.2f %s '%('\n Torque = ',T,' in-lb.');
##Power
n=175.*2./3.;
P=T*n/63000.;
print'%s %.2f %s '%('\n Power = ',P,' hp.');