##Chapter-4, Illustration 1, Page 133
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
TA=48.;##Wheel A teeth
TB=30.;##Wheel B teeth
m=5.;##Module pitch in mm
phi=20.;##Pressure angle in degrees
add=m;##Addendum in mm
##CALCULATIONS
R=(m*TA)/2.;##Pitch circle radius of wheel A in mm
RA=R+add;##Radius of addendum circle of wheel A in mm
r=(m*TB)/2.;##Pitch circle radius of wheel B in mm
rA=r+add;##Radius of addendum circle of wheel B in mm
lp=(math.sqrt((RA**2.)-((R**2.)*(math.cos(phi/57.3)**2.))))+(math.sqrt((rA**2.)-((r**2.)*(math.cos(phi/57.3)**2.))))-((R+r)*math.sin(phi/57.3));##Length of path of contact in mm
la=lp/math.cos(phi/57.3);##Length of arc of contact in mm
##OUTPUT
print'%s %.1f %s'%('Length of arc of contact is ',la,' mm')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 2, Page 133
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
TA=40.;##Wheel A teeth
TB=TA;##Wheel B teeth
m=6.;##Module pitch in mm
phi=20.;##Pressure angle in degrees
pi=3.141
x=1.75;##Ratio of length of arc of contact to circular pitch
##CALCULATIONS
Cp=m*pi;##Circular pitch in mm
R=(m*TA)/2.;##Pitch circle radius of wheel A in mm
r=R;##Pitch circle radius of wheel B in mm
la=x*Cp;##Length of arc of contact in mm
lp=la*math.cos(phi/57.3);##Length of path of contact in mm
RA=math.sqrt((((lp/2.)+(R*math.sin(phi/57.3)))**2.)+((R**2.)*(math.cos(phi/57.3))**2.));##Radius of addendum circle of each wheel in mm
add=RA-R;##Addendum in mm
##OUTPUT
print'%s %.1f %s'%('Addendum of wheel is ',add,' mm')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 3, Page 134
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
TA=48.;##Gear teeth
TB=24.;##Pinion teeth
m=6.;##Module in mm
phi=20.;##Pressure angle in degrees
##CALCULATIONS
r=(m*TB)/2.;##Pitch circle radius of pinion in mm
R=(m*TA)/2.;##Pitch circle radius of gear in mm
RA=math.sqrt(((((r*math.sin(phi/57.3))/2.)+(R*math.sin(phi/57.3)))**2.)+((R**2)*(math.cos(phi/57.3))**2));##Radius of addendum circle of gear in mm
rA=math.sqrt(((((R*math.sin(phi/57.3))/2.)+(r*math.sin(phi/57.3)))**2.)+((r**2)*(math.cos(phi/57.3))**2));##Radius of addendum circle of pinion in mm
addp=rA-r;##Addendum for pinion in mm
addg=RA-R;##Addendum for gear in mm
lp=((R+r)*math.sin(phi/57.3))/2.;##Length of path of contact in mm
la=lp/math.cos(phi/57.3);##Length of arc of contact in mm
##OUTPUT
print'%s %.1f %s %.1f %s %.1f %s '%('Addendum for pinion is',addp,' mm' ' Addendum for gear is ',addg,' mm' ' Length of arc of contact is ',la,' mm')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 4, Page 135
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
x=3.5;##Ratio of teeth of wheels
C=1.2;##Centre distance between axes in m
DP=4.4;##Diametrical pitch in cm
##CALCULATIONS
D=2*C*100.;##Sum of diameters of wheels in cm
T=D*DP;##Sum of teeth of wheels
TB1=T/(x+1);##Teeth of wheel B
TB=math.floor(TB1);##Teeth of whhel B
TA=x*TB;##Teeth of wheel A
DA=TA/DP;##Diametral pitch of gear A in cm
DB=TB/DP;##Diametral pitch of gear B in cm
Ce=(DA+DB)/2.;##Exact centre distance between shafts in cm
TB2=math.ceil(TB1);##Teeth of wheel B
TA2=T-TB2;##Teeth of wheel A
VR=TA2/TB2;##Velocity ratio
##OUTPUT
print'%s %.1f %s %.1f %s %.1f %s%.1f %s%.1f %s'%('Number of teeth on wheel A is ',TA,'' 'Number of teeth on wheel B is ',TB,'' ' Exact centre distance is ',Ce,' cm ' 'If centre distance is ',C,' m' 'then Velocity ratio is',VR,'')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 5, Page 136
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
C=600;##Distance between shafts in mm
Cp=30;##Circular pitch in mm
NA=200;##Speed of wheel A in rpm
NB=600;##Speed of wheel B in rpm
F=18;##Tangential pressure in kN
pi=3.141
##CALCULATIONS
a=Cp/(pi*10.);##Ratio of pitch diameter of wheel A to teeth of wheel A in cm
b=Cp/(pi*10.);##Ratio of pitch diameter of wheel B to teeth of wheel B in cm
T=(2*C)/(a*10.);##Sum of teeth of wheels
r=NB/NA;##Ratio of teeth of wheels
TB=T/(r+1);##Teeth of wheel B
TB1=math.ceil(TB);##Teeth of wheel B
TA=TB1*r;##Teeth of wheel A
DA=a*TA;##Pitch diameter of wheel A in cm
DB=b*TB1;##Pitch diameter of wheel B in cm
CPA=(pi*DA)/TA;##Circular pitch of gear A in cm
CPB=(pi*DB)/TB1;##Circular pitch of gear B in cm
C1=(DA+DB)*10/2.;##Exact centre distance in mm
P=(F*1000.*pi*DA*NA)/(60.*1000.*100.);##Power transmitted in kW
##OUTPUT
print'%s %.1f %s %.1f %s %.1f %s %.1f %s %.1f %s %.1f %s %.1f %s %.1f %s '%('Number of teeth on wheel A is ',TA,' '' Number of teeth on wheel B is ',TB1,' '' Pitch diameter of wheel A is ',DA,' cm'' Pitch diameter of wheel B is ',DB,' cm'' Circular pitch of wheel A is',CPA,'cm ' 'Circular pitch of wheel B is ',CPB,' cm '' Exact centre distance between shafts is ',C1,' mm'' Power transmitted is',P,' kW')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 6, Page 137
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
r=16.;##Speed ratio
mA=4.;##Module of gear A in mm
mB=mA;##Module of gear B in mm
mC=2.5;##Mosule of gear C in mm
mD=mC;##Module of gear D in mm
C=150.;##Distance between shafts in mm
##CALCULATIONS
t=math.sqrt(r);##Ratio of teeth
T1=(C*2.)/mA;##Sum of teeth of wheels A and B
T2=(C*2.)/mC;##Sum of teeth of wheels C and D
TA=T1/(t+1.);##Teeth of gear A
TB=T1-TA;##Teeth of gear B
TC=T2/(t+1.);##Teeth of gear C
TD=T2-TC;##Teeth of gear D
##OUTPUT
print'%s %.1f %s %.1f %s %.1f %s %.1f %s '%('Number of teeth on gear A is ',TA,' '' Number of teeth on gear B is ',TB,'' 'Number of teeth on gear C is ',TC,'' ' Number of teeth on gear D is ',TD,'')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 7, Page 138
##Title: Gears and Gear Drivers
##=============================================================================
import math
##INPUT DATA
N=4.5;##No. of turns
##CALCULATIONS
Vh=N/2.;##Velocity ratio of main spring spindle to hour hand spindle
Vm=12.;##Velocity ratio of minute hand spindle to hour hand spindle
T1=8.## assumed no of teeth on gear 1
T2=32.## assumed no of teeth on gear 2
T3=(T1+T2)/4.## no of teeth on gear 3
T4=(T1+T2)-T3## no of teeth on gear 4
print'%s %.1f %s %.1f %s %.1f %s %.1f %s '%('no of teeth on gear 1=',T1,'' 'no of teeth on gear 2=',T2,' ''no of teeth on gear 3=',T3,' ''no of teeth on gear 4=',T4,'')
##Chapter-4, Illustration 8, Page 139
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
Tb=70.;##Teeth of wheel B
Tc=25.;##Teeth of wheel C
Td=80.;##Teeth of wheel D
Na=-100.;##Speed of arm A in clockwise in rpm
y=-100.##Arm A rotates at 100 rpm clockwise
##Calculations
Te=(Tc+Td-Tb);##Teeth of wheel E
x=(y/0.5)
Nc=(y-(Td*x)/Tc);##Speed of wheel C in rpm
##Output
print'%s %.1f %s'%('Speed of wheel C is ',Nc,' rpm ''Direction of wheel C is anti-clockwise')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 9, Page 140
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
Tb=25.;##Teeth of wheel B
Tc=40.;##Teeth of wheel C
Td=10.;##Teeth of wheel D
Te=25.;##Teeth of wheel E
Tf=30.;##Teeth of wheel F
y=-120.;##Speed of arm A in clockwise in rpm
##Calculations
x=(-y/4.)
Nb=x+y;##Speed of wheel B in rpm
Nf=(-10/3.)*x+y;##Speed of wheel F in rpm
##Output
print'%s %.1f %s %.1f %s'%('Speed of wheel B is',Nb,' rpm Direction of wheel B is clockwise' ' Speed of wheel F is ',Nf,' rpm Direction of wheel F is clockwise')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 10, Page 141
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
Ta=96.;##Teeth of wheel A
Tc=48.;##Teeth of wheel C
y=-20.;##Speed of arm C in rpm in clockwise
##Calculations
x=(y*Ta)/Tc
Tb=(Ta-Tc)/2.;##Teeth of wheel B
Nb=(-Tc/Tb)*x+y;##Speed of wheel B in rpm
Nc=x+y;##Speed of wheel C in rpm
##Output
print'%s %.1f %s %.1f %s'%('Speed of wheel B is ',Nb,' rpm' 'Speed of wheel C is ',Nc,' rpm')
##================================END OF PROGRAM=============================================
##Chapter-4, Illustration 11, Page 142
##Title: Gears and Gear Drivers
##=============================================================================
import math
import numpy
from numpy.linalg import inv
##Input data
Ta=40.## no of teeth on gear A
Td=90.## no of teeth on gear D
##Calculations
Tb=(Td-Ta)/2.## no of teeth on gear B
Tc=Tb## no of teeth on gear C
##
##x+y=-1
##-40x+90y=45
A=([[1, 1],[-Ta, Td]])##Coefficient matrix
B=([[-1],[Td/2]])##Constant matrix
X=numpy.dot(inv(A) ,B)##Variable matrix
##
##x+y=-1
##-40x+90y=0
A1=([[1, 1],[-Ta, Td]])##Coefficient matrix
B1=([[-1],[0]])##Constant matrix
X1=numpy.dot(inv(A1) ,B1)##Variable matrix
b=X1[1]
print(X[1])
print'%s %.4f %s'%('speed of the arm =',b,' revolution clockwise')
##Chapter-4, Illustration 12, Page 144
##Title: Gears and Gear Drivers
##=============================================================================
##Input data
Te=30.;##Teeth of wheel E
Tb=24.;##Teeth of wheel B
Tc=22.;##Teeth of wheel C
Td=70.;##Teeth of wheel D
Th=15.;##Teeth of wheel H
Nv=100.;##Speed of shaft V in rpm
Nx=300.;##Speed of spindle X in rpm
##Calculations
Nh=Nv;##Speed of wheel H in rpm
Ne=(-Th/Te)*Nv;##Speed of wheel E in rpm
Ta=(Tc+Td-Tb);##Teeth of wheel A
##x+y=-50
##y=300
x=(Ne-Nx)
Nz=(187/210.)*x+Nx;##;##Speed of wheel Z in rpm
##Output
print'%s %.1f %s'%('Speed of wheel Z is ',Nz,' rpm Direction of wheel Z is opposite to that of X')
##Chapter-4, Illustration 13, Page 145
##Title: Gears and Gear Drivers
##=============================================================================
##Input data
Tp=20.;##Teeth of wheel P
Tq=30.;##Teeth of wheel Q
Tr=10.;##Teeth of wheel R
Nx=50.;##Speed of shaft X in rpm
Na=100.;##Speed of arm A in rpm
##Calculations
##x+y=-50
##y=100
x=(-Nx-Na)
y=(-2.*x+Na);##Speed of Y in rpm
##Output
print'%s %.1f %s'%('Speed of driven shaft Y is ',y,' rpm Direction of driven shaft Y is anti-clockwise')
##Chapter-4, Illustration 14, Page 146
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
d=216.;##Ring diameter in mm
m=4.;##Module in mm
##Calculations
Td=(d/m);##Teeth of wheel D
Tb=Td/4.;##Teeth of wheel B
Tb1=math.ceil(Tb);##Teeth of wheel B
Td1=4.*Tb1;##Teeth of wheel D
Tc1=(Td1-Tb1)/2.;##Teeth of wheel C
d1=m*Td1;##Pitch circle diameter in mm
##Output
print'%s %.1f %s %.1f %s %.1f %s%.1f %s '%('Teeth of wheel B is ',Tb1,' ' 'Teeth of wheel C is ',Tc1,' ' 'Teeth of wheel D is ',Td1,' '' Exact pitch circle diameter is ',d1,' mm')
##Chapter-4, Illustration 15, Page 147
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
Ta=100.## no of teeth on gear A
Tc=101.## no of teeth on gear C
Td=99.## no of teeth on gear D
Tp=20.## no of teeth on planet gear
y=1.## from table 4.9(arm B makes one revolution)
x=-y## as gear is fixed
##Calculations
Nc=(Ta*x)/Tc+y## Revolution of gear C
Nd=(Ta*x)/Td+y## Revolution of gear D
##Output
print'%s %.4f %s %.4f %s '%('Revolution of gear C =',Nc,'' ' Revolution of gear D = ',Nd,'')
##Chapter-4, Illustration 16, Page 148
##Title: Gears and Gear Drivers
##=============================================================================
import math
##Input data
Ta=12.## no of teeth on gear A
Tb=60.## no of teeth on gear B
N=1000.## speed of propeller shaft in rpm
Nc=210.## speed of gear C in rpm
##Calculations
Nb=(Ta*N)/Tb## speed of gear B in rpm
x=(Nb-Nc)
Nd=Nb+x## speed of road wheel driven by D
##Output
print'%s %.1f %s'%('speed of road wheel driven by D= ',Nd,' rpm')
##Chapter-4, Illustration 17, Page 148
##Title: Gears and Gear Drivers
##=============================================================================
import math
import numpy
from numpy.linalg import inv
##Input data
Ta=20.## no of teeth on pinion A
Tb=25.## no of teeth on wheel B
Tc=50.## no of teeth on gear C
Td=60.## no of teeth on gear D
Te=60.## no of teeth on gear E
Na=200.## SPEED of the gear A
Nd=100.## speed of the gear D
##calculations
##(i)
##(5/6)x+y=0
##(5/4)x+y=200
A1=([[Tc/Td, 1],[Tb/Ta, 1]])##Coefficient matrix
B1=([[0],[Na]]) ##Constant matrix
X1=numpy.dot(inv(A1),B1)##Variable matrix
Ne1=X1[1]-(Tc/Td)*X1[0]##
T1=(-Ne1/Na)## ratio of torques when D is fixed
##(ii)
##(5/4)x+y=200
##(5/6)x+y=100
A2=([[Tc/Td, 1],[Tb/Ta, 1]])##Coefficient matrix
B2=([[Nd],[Na]])##Constant matrix
X2=numpy.dot(inv(A2),B2)##Variable matrix
Ne2=X2[1]-(Tc/Td)*X2[0]
T2=(-Ne2/Na)## ratio of torques when D ratates at 100 rpm
##Output
print'%s %.2f %s %.2f %s %.2f %s %.2f %s'%('speed of E= ',Ne1,' rpm in clockwise direction' and 'speed of E in 2nd case(when D rotates at 100 rpm)= ',Ne2,' rpm in clockwise direction' and 'ratio of torques when D is fixed= ',T1,' ' 'ratio of torques when D ratates at 100 rpm= ',T2,'')