import math
#Initilization of variables
G=84 #Gpa #Modulus of Rigidity
N=110 #no. of revolution
#d*D**-1=0.6 #Ratio of inner diameter to outer diameter
sigma_s=63 #MPa #shear stress
L=3 #m #Length of shaft
P=590 #KW #Power
#Calculation
#P=2*pi*N*T_mean*60000**-1 #KW #Power
T_mean=P*60000*(2*pi*N)**-1 #N*m #Mean Torque
#I_p=p*32**-1*(D**4-d**4)
#After substituting value of d in above equation we get
#I_p=0.0272*pi*D**4 #m**4 #Polar moment of Inertia
T_max=1.2*T_mean #N*m #Max torque
#Using Relation
#T_max*T_p**-1=sigma_s*R**-1=G*theta*L**-1
#After substituting values and simplifying we get
D=(5.7085*10**-3)**0.3333 #m #Diameter of shaft
theta=1.4*pi*180**-1 #radians
#theta=((T_max*L)*(G*10**9*I_p)) #radians
#After substituting values and simplifying we get
D_1=(1.0513*10**-3)**0.25
#Result
print"The Minimum external diameter is",round(D_1,2),"m"
import math
#Initilization of variables
P=295 #KW #Power
N=100 #R.p.m
sigma_s=80 #MPa #shear stress
#Calculations
T_mean=((P*60000)*(2*pi*N)**-1) #N*m
#T_max=T_mean=(pi*D**3*sigma_s)*16**-1
D=((T_mean*16)*(pi*sigma_s*10**6)**-1)**0.333 #m #Diameter of solid shaft
#For hollow shaft
#I_p_h=pi*32**-1*(D_1**4-d_1**4) (equation 1)
#Now d_1=0.6*D_1
#substituting above value in equation 1,we get,
#I_p_h=0.0272*pi*D_1**4
#For solid shaft
#I_p_s=pi*32**-1*D**4
#T and sigma_s being the same then I_p*R**-1 will be the same for the two shafts
#Using relation I_p_h*R_1**-1=I_p_s*R**-1
#Substituting values and simplifying we get
D_1=(D**3*0.8704**-1)**0.3333333 #m #External diameter of hollow shaft
d_1=0.6*D_1 #cm #Internal diameter of hollow shaft
A_s=pi*4**-1*(D*10**2)**2 #cm**2 #Area of solid shaft
A_h=pi*4**-1*(((D_1*10**2)**2)-((d_1*10**2)**2))
W=(A_s-A_h)*A_s**-1*100 #Percentage #Percentage saving in weight
#Result
print"Diameter of solid shaft is ",D,"m"
print"Percentage saving in weight is",round(W,2),"%"
import math
#Initilization of variables
P_C=45 #KW Power aplled at C
P_B=15 #KW Power taken off at B
P_BA=30 #KW #Power transmitted across BA
G=85 #GPa
#Calculations (Part-1)
#For BC
P_1=45 #KW #Power across BC
N_1=200 #r.p.m
d_1=0.075 #m #diameter of shaft BC
L_BC=2 #m #Length of shaft BC
T_BC=60000*P_1*(2*pi*N_1)**-1 #N*m #Torque transmitted across BC
sigma_s_BC=16*T_BC*((pi*(d_1)**3)**-1)*10**-6 #N/m**2 #max shear stress in BC
I_p_BC=pi*32**-1*d_1**4 #m**4 #Polar M.I of BC
theta_1=T_BC*L_BC*(G*10**9*I_p_BC)**-1 #Radian #Max angle of twist theta_1 in BC of B relative to C
#For AB
P_2=30 #KW #Power across AB
N_2=200 #r.p.m
d_2=0.05 #m #diameter of shaft AB
L_BC=4 #m #Length of shaft AB
T_AB=60000*P_2*(2*pi*N_2)**-1 #N*m #Torque transmitted across AB
sigma_s_AB=16*T_AB*(pi*(d_2)**3)**-1*10**-6 #N/m**2 #max shear stress in AB
I_p_AB=pi*32**-1*d_2**4 #m**4 #Polar M.I of AB
theta_2=T_AB*L_BC*(G*10**9*I_p_AB)**-1 #Radian #Max angle of twist theta_1 in AB of A relative to B
C=(theta_1+theta_2)*180*pi**-1 #radian #Angle of Twist of gear
#Result
print"Angle of Twist of gear is",round(C,2),"Degree"
print"The maximum shear stress developed in the shaft AB is",round(sigma_s_AB,2)
import math
#Initilization of variables
L_BC=1.8 #m #Length of BC
L_AB=1.2 #m #Length of AB
sigma_s=70 #MPa #shear stress
d_1=0.05 #m #diameter of BC
d_2=0.1 #m #diameter of AB
r_BC=0.025 #cm #Radius of BC
#Calculations
I_p_BC=pi*32**-1*d_1**4 #m**4 #Polar M.I of BC
I_p_AB=pi*32**-1*d_2**4 #m**4 #Polar M.I od AB
#For BC
#theta_1=T*L_BC*(G*10**9*I_p_BC)**-1 #Angle of Twist of C relative to B
#After substituting and simplifying value, we get
#theta_1=3.4923*10**-5*T
#For AB
#theta_2=T*L_AB*(G*10**9*I_p_AB)**-1 #Angle of Twist of B relative to A
#After substituting and simplifying value, we get
#theta_2=1.45513*T
#sigma_s=T*R*(I_P)**-1 #The max shear stress in BC
#After substituting and simplifying value in above equation, we get
T=sigma_s*10**6*I_p_BC*r_BC**-1
theta_1=3.4923*10**-5*T
theta_2=1.45513*10**-6*T
theta_c=theta_1-theta_2 #radian #total angle of twist
#Result
print"Total angle of Twist is",round(theta_c,3),"radian"
import math
#Initilization of variables
D=0.05 #m #Diameter of shaft
sigma_s_a=55 #MPa #shear stress of alloy
sigma_s_s=80 #MPa #shear stress of steel
P=185 #KW #Power
#Calculations
#For alloy shaft,
#theta*L**-1=T*(G_A*I_p_A)**-1
#For steel shaft,
#theta*L*-1=I*(G_S*I_p_S)**-1
#After substituting and simplifying we get
d=(246.2*10**-8)**0.25 #m #Internal diameter of steel shaft
T_1=pi*16**-1*D**3*sigma_s_s*10**6 #N*m #For alloy shaft max torque
T_2=pi*16**-1*((D**4-d**4)*D**-1)*sigma_s_s*10**6 #N*m #For steel shaft max torque
#Permissible torque,T_2
#P=2*pi*N*T_2*(60000)**-1
#After substituting we get
N=P*60000*(2*pi*T_2)**-1 #r.p.m #Speed
#Result
print"The speed at which the shafts to be driven is",round(N,0),"r.p.m"
import math
#Initilization of variables
sigma_s=90 #MPa #shear stress of steel
sigma_d=60 #MPa #shear stress of duralumin
G_d=28 #GPa #modulus of rigidity of duralumin
G_s=84 #GPa #modulus of rigidity of steel
L=1 #m #Length of shaft
#Calculations
#theta*L**-1=sigma_s*(G_s*R_s)**-1=sigma_d*(G_d*R_d)**-1
#After substituting and simplifying,we get,
#D=2*d
#T_s=pi*16**-1*d**3*sigma_s #N*m #torque of steel
#T_d=pi*16*(((D**4-d**4)*D**4)**-1)*sigma_d #N*m #torque of duralumin
#After substituting and simplifying above two equations,we get,
#T_s=17.6714*10**6*d**3 #N*m
#T_d=88.3572*d**3 #N*m
#T=T_s+T_d #Total torque
#T=106.02875*10**6*d**3
d=(700*(106.02875*10**6)**-1)**0.333 #m
D=2*d #m
R_s=d*2**-1 #m
theta=(sigma_s*10**6*L*(G_s*10**9*R_s)**-1)*180*pi**-1 #degree #Angle of twist
#Result
print"The Angle of Twist is",round(theta,2),"Degree"
import math
#Initilization of variables
P=4415 #KW #Power transmitted
N=110 #r.p.m
sigma_s=75 #MPs #shear stress
G=85 #GPa
#Calculations
#D=2*d
T=P*60000*(2*pi*N)**-1 #N*m #Torque Transmitted
#T=pi*16**-1*(D**4-d**4)*D**-1*sigma_s #N*m
#After substituting and simplifying above equations,we get,
D=(T*16*pi**-1*(sigma_s*10**6)**-1)**(1*3**-1)
d=D*2**-1
X=5*(sigma_s*10**6)**2*(16*G*10**9)**-1
#U*V**-1 #Energy stored
#X=U*V**-1 #Energy stored #Notations has been changed
#Result
print"Diameter of shaft is:D",round(D,2),"cm"
print" :d",round(d,2),"cm"
print"Energy stored per cubic meter is",round(X,2),"N/m**2"
import math
#Initilization of variables
P=3680 #KW #Power transmitted
N=110 #r.p.m
X=20000 #N*m #Energy stored
G=85 #GPa
#Calculations
#U*V**-1=X #Strain Energy per unit volume #Notification has been changed
#X=sigma_s**2*(4*G)**-1*((D**2+d**2)*(D**2)**-1)
T=P*60000*(2*pi*N)**-1 #N*m #Torque transmitted by shaft
sigma_s=(20000*3*G*10**9)**(1*2**-1) #MPa #shear stress of shaft
#T=pi*16**-1*((D**4-d**4)*D**-1)*sigma_s
#After substituting and simplifying above equations,we get,
d=((T*16*3**0.5)*(pi*8*sigma_s)**-1)**(1*3**-1)
D=3**0.5*d
#Result
print"Diameter of shaft is D=",round(D,2),"m"
print" d=",round(d,2),"m"
import math
#Initilization of variables
D=8 #cm #Diameter of bronze
d=5 #cm #diameter of steel shaft
R_b=4 #cm #Radius of bronze
R_s=2.5 #cm #Radius of steel shaft
sigma_b=40 #MPa #shear stress of bronze
sigma_s=65 #MPa #shear stress of steel shaft
N=500 #r.p.m
G_s=85 #GPa #Modulus of rigidity of steel
G_b=45 #GPa #Modulus of rigidity of bronze
#Calculations
I_p_s=pi*32**-1*(5*10**-2)**4 #m**4 #Polar M.I of Steel shaft
I_p_b=pi*32**-1*((8*10**-2)**4-(5*10**-2)**4) #m**4 #Polar M.I of Bronze shaft
#T*(G_b*I_p_b)**-1=T_s*(G_s*I_s)**-1
#After substituting and simplifying above equations,we get
#T_b=2.94*T_s
T_b=I_p_b*sigma_b*10**6*(R_b*10**-2)**-1 #N*m #Torque carried by bronze
T_s=I_p_s*sigma_s*10**6*(R_s*10**-2)**-1 #N*m #Torque carried by steel shaft
T_s_1=T_b*2.94**-1 #N*m
T=T_b+T_s_1 #N*m #Total Torque
P=(2*pi*N*T*(60000)**-1) #KW #Power transmitted
#Result
print"Power transmitted by compound shaft is",round(P,2),"KW"
import math
#Initilization of variables
d=10 #cm #Diameter of shaft
r=5 #cm #radius of shaft
P=100 #KW #Power
N=120 #r.p.m
n=6
L_k=14 #cm #Length of key
B_k=2.5 #cm #width of key
n=6
d_b=2 #cm #Diameter of bolt
D_b=30 #cm #Diameter of bolt circle
R_b=15 #cm #radius
#Calculations
T=(P*60000*(2*pi*N)**-1)*10**2 #N*m #Torque
I_p=pi*32**-1*d**4 #Polar M.I of shaft
sigma_s=T*r*(I_p)**-1 #N/cm**2
sigma_k=T*(L_k*B_k*r)**-1 #N/cm**2
sigma_b=T*4*(n*pi*d_b**2*R_b)**-1 #N/cm**2
#Result
print"shear stress in shaft",round(sigma_s,2),"N/cmm**2"
print" Key",round(sigma_k,2),"N/cm**2"
print" bolts",round(sigma_b,2),"N/cm**2"