import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-14.1 Page No.306\n');
##Torque on small pulley
hp=2.;
n=2450.;
T=63000.*hp/n;
print'%s %.2f %s '%('\n Torque on small pulley = ',T,' in-lb.');
r=6/2.;
Fd=T/r;
##Front force
Fb=10.;
Ff=Fd+Fb;
print'%s %.2f %s '%('\n Front force = ',Ff,' lb.');
##Force pulling the shafts
Ft=Ff+Fb
print'%s %.2f %s '%('\n Force pulling the shafts = ',Ft,' lb.');
##Surface speed
D=2.*r;
Vm=math.pi*D*n/12.;
print'%s %.2f %s '%('\n Surface speed = ',Vm,' ft/min.');
##Ratio
D2=10.;
Mw=D2/D;
print'%s %.2f %s '%('\n Ratio = ',Mw,'');
##Output speed
no=n/Mw;
print'%s %.2f %s '%('\n Output speed = ',no,' rpm.');
##Note-There is an error in the answer given in textbook
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-14.2 Page No.310\n');
##Length of belt
C=19.;
D1=4.;
D2=6.;
L1=2.*C+1.57*(D1+D2)+(D2-D1)**2./(4.*C);
##Assuming a 54-inch belt is available
L=54.;
print'%s %.2f %s '%('\n Length of belt = ',L,' in.');
##Centerline distance
B=4.*L-6.28*(D2+D1);
C=(B+math.sqrt(B**2.-32.*(D2-D1)**2))/16.;
print'%s %.2f %s '%('\n Centerline distance = ',C,' in.');
##Ratio
Mw=D2/D1;
print'%s %.2f %s '%('\n Ratio = ',Mw,'');
##Surface speed
n=1800.;
Vm=math.pi*D1*n/12.;
print'%s %.2f %s '%('\n Surface speed =',Vm,' ft/min.');
##Angle of contact
theta=180.-2*(180./math.pi)*math.asin((D2-D1)/(2.*C));
print'%s %.2f %s '%('\n Angle of contact = ',theta,' deg.');
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-14.3 Page No.315\n');
##Power rating of belt
P1=27.+2.98;
SF=1.5;
P=P1/SF;
P=round(P);
print'%s %.2f %s '%('\n Power rating = ',P,' hp.');
##Length of belt
C=20.;
D1=8.;
D2=16.;
L1=2.*C+1.57*(D1+D2)+(D2-D1)**2/(4.*C);
##Use an 80-inch belt
L=80.;
print'%s %.2f %s '%('\n Length of belt = ',L,' in.');
import math
print('MACHINE DESIGN \n Timothy H. Wentzell, P.E. \n EXAMPLE-14.4 Page No.321\n');
P=5.31;
print'%s %.2f %s '%('\n Horsepower rating = ',P,' hp.');
Nti=12.;
N1=1800.;
N2=900.;
##Output sprocket
Nto=(N1/N2)*Nti;
print'%s %.2f %s '%('\n Number of tooth on output sprocket = ',Nto,'');
##Surface speed
Pc=0.5;
D1=Pc*Nti/math.pi;
n=1800.;
Vm=math.pi*D1*n/12.;
print'%s %.2f %s '%('\n Surface speed = ',Vm,' ft/min.');
print('\n Type of lubrication - Bath or disc lubrication');
##Length of chain
C=10.;
D2=Pc*Nto/math.pi;
L1=2*C+1.57*(D1+D2)+(D2-D1)**2/(4.*C);
##Use 29 or 30 inch chain
L=30.;
print'%s %.2f %s '%('\n Length of chain = ',L,' in.');
hp=5.31;
T=63000.*hp/n;
F=2.*T/D1;
print'%s %.2f %s '%('\n Force in chain = ',F,' lb.');
##Comparism with ultimate strength 3700 lb - not a valid comparison because of speed etc.