#Given
dia = 10 #diameter of shaft(A-C)
c = dia/2 #mm - Radius
T = 30 #N/mm -Torque in the shaft
#Caliculations
J = 3.14*(dia**4)/32 #mm4
shear_T = T*c*pow(10,3)/J # The torsion shear in the shaft AC
import numpy as np
print "The maximum shear due to torsion is ",round(shear_T,2),"Mpa"
arr_T = np.zeros((3,3))
arr_T[0][1]=round(shear_T,1) #arranging the elements in array
arr_T[1][0]=round(shear_T,1)
print "stress tensor matrix",(arr_T),
#Given
dia_out = 20 #mm- outer diameter of shaft
dia_in = 16 #mm- inner diameter of shaft
c_out = dia_out/2 #mm - outer Radius of shaft
c_in = dia_in/2 #mm - inner radius of shaft
T = 40 #N/mm -Torque in the shaft
#caliculations
J = 3.14*((dia_out**4)- (dia_in**4))/32 #mm4
shear_T_max = T*c_out*pow(10,3)/J # The maximum torsion shear in the shaft
shear_T_min = T*c_in*pow(10,3)/J # The maximum torsion shear in the shaft
print "The maximum shear due to torsion is ",round(shear_T_max,2),"Mpa"
print "The minimum shear due to torsion is ",round(shear_T_min,2),"Mpa"
#Given
hp = 10 # horse power of motor
f = 30 # given
shear_T = 55 #Mpa - The maximum shearing in the shaft
#caliculations
T = 119*hp/f # N.m The torsion in the shaft
#j/c=T/shear_T=K
k = T*pow(10,3)/shear_T #mm3
#c3=2K/3.14
c = pow((2*k/3),0.33) #mm - The radius of the shaft
diamter = 2*c #mm - The diameter of the shaft
print "The Diameter of the shaft used is",round(diamter,2),"mm"
#Given
hp = 200 #Horse power
stress_sh = 10000 #psi- shear stress
rpm_1 = 20.0 # The rpm at which this shaft1 operates
rpm_2 = 20000.0 # The rpm at which this shaft2 operates
T_1= hp*63000.0/rpm_1 #in-lb Torsion due to rpm1
T_2= hp*63000/rpm_2 #in-lb Torsion due to rpm1
#caliculations
#j/c=T/shear_T=K
k_1= T_1/stress_sh #mm3
#c3=2K/3.14
c_1= pow((2*k_1/3),0.33) #mm - The radius of the shaft
diamter_1 = 2*c_1 #mm - The diameter of the shaft
print "The Diameter of the shaft1 is",round(diamter_1,2),"mm"
#j/c=T/shear_T=K
k_2= T_2/stress_sh #mm3
#c3=2K/3.14
c_2= pow((2*k_2/3),0.33) #mm - The radius of the shaft
diamter_2 = 2*c_2 #mm - The diameter of the shaft
print "The Diameter of the shaft2 is",diamter_2,"mm"
#Given
T_ab = 0 #N.m - torsion in AB
T_bc = 150 #N.m - torsion in BC
T_cd = 150 #N.m - torsion in CD
T_de = 1150 #N.m - torsion in DE
l_ab = 250 #mm - length of AB
l_bc = 200 #mm - length of BC
l_cd = 300 #mm - length of cd
l_de = 500.0 #mm - length of de
d_1 = 25 #mm - outer diameter
d_2 = 50 #mm - inner diameter
G = 80 #Gpa -shear modulus
#Caliculations
J_ab = 3.14*(d_1**4)/32 #mm4
J_bc = 3.14*(d_1**4)/32 #mm4
J_cd = 3.14*(d_2**4 - d_1**4)/32 #mm4
J_de = 3.14*(d_2**4 - d_1**4)/32 #mm4
rad = T_ab*l_ab/(J_ab*G)+ T_bc*l_bc/(J_bc*G)+ T_cd*l_cd/(J_cd*G)+ T_de*l_de/(J_de*G) # adding the maximum radians roteted in each module
print "The maximum angle rotated is ",rad,"radians "
#given
#its a statistally indeterminant
#we will take of one of the support
#Given
T_ab = 0 #N.m - torsion in AB
T_bc = 150 #N.m - torsion in BC
T_cd = 150 #N.m - torsion in CD
T_de = 1150 #N.m - torsion in DE
l_ab = 250 #mm - length of AB
l_bc = 200 #mm - length of BC
l_cd = 300 #mm - length of cd
l_de = 500.0#mm - length of de
d_1 = 25 #mm - outer diameter
d_2 = 50 #mm - inner diameter
#Caliculations
J_ab = 3.14*(d_1**4)/32 #mm4
J_bc = 3.14*(d_1**4)/32 #mm4
J_cd = 3.14*(d_2**4 - d_1**4)/32 #mm4
J_de = 3.14*(d_2**4 - d_1**4)/32 #mm4
G = 80 #Gpa -shear modulus
rad = T_ab*l_ab/(J_ab*G)+ T_bc*l_bc/(J_bc*G)+ T_cd*l_cd/(J_cd*G)+ T_de*l_de/(J_de*G)
#now lets consider T_A then the torsion is only T_A
# T_A*(l_ab/(J_ab*G)+ l_bc/(J_bc*G)+ l_cd/(J_cd*G)+ l_de/(J_de*G)) +rad = 0
# since there will be no displacement
T_A =-rad/(l_ab/(J_ab*G)+ l_bc/(J_bc*G)+ l_cd/(J_cd*G)+ l_de/(J_de*G)) #Torsion at A
T_B = 1150 - T_A #n-m F_X = 0 torsion at B
print "The Torsion at rigid end A is",round(T_A,2),"N-m"
print "The Torsion at rigid end B is",round(T_B,2),"N-m"
#Given
dai_bc = 240 #mm- daimeter of '8'bolt circle
dia = dai_bc/8 #Diameter of each bolt
A = 0.25*(dia**2)*3.14 # Area of a bolt
S_allow = 40 #Mpa - The maximum allowable allowable shear stress
P_max = (S_allow)*A #N - The maximum allowable force
D = 120.0 #mm - the distance from central axis
T_allow =P_max*D*8 #N-m The allowable torsion on the 8 bolt combination
print "The allowable torsion on the 8 bolt combination",T_allow ,"N-m"
#Given
#AISC MANUALS
#approximated by three narrow tubes
#J = Bbt^3
B = 0.33 # constant mentiones in AISC
#three rods
#rod_1
t_1 = 0.605 #inch - Thickness
b = 12.0 #inches - width
J_1 = B*b*(t_1**3) #in4 - Torsion constant
#rod_2
t_2 = 0.605 #inch - Thickness
b = 12 #inches - width
J_2 = B*b*(t_2**3) #in4 - Torsion constant
#rod_3
t_3 = 0.390 #inch - Thickness
b = 10.91 #inches - width
J_3 = B*b*(t_3**3) #in4 - Torsion constant
#Equivalent
J_eq = J_1+J_2+J_3 #in4 - Torsion constant
print "the Equivalent Torsion constant is ",round(J_eq,2), "in4"
#Given
dia_out = 10 #mm- outer diameter of shaft
dia_in = 8 #mm- inner diameter of shaft
c_out = dia_out/2 #mm - outer Radius of shaft
c_in = dia_in/2 #mm - inner radius of shaft
T = 40 #N/mm -Torque in the shaft
#caliculations
J = 3.14*((dia_out**4)- (dia_in**4))/32 #mm4
shear_T_max = T*c_out*pow(10,3)/J # The maximum torsion shear in the shaft
shear_T_min = T*c_in*pow(10,3)/J # The maximum torsion shear in the shaft
print "The maximum shear due to torsion is ",round(shear_T_max,2),"Mpa"
print "The minimum shear due to torsion is ",round(shear_T_min,2),"Mpa"