# Chapter 5:Torsion¶

## Example 5.2 Page No 188¶

In :
#Given
T1 = 4250.0        #kNmm, torque
T2 = -3000.0       #kNm
T3 = T1+T2         #kNm

#Calculation
#Section Property
import math
J = (math.pi/2.0)*(r**4) #polar moment of inertia
#Shear Stress
c_a = 75 #mm
tou_a = (T3*c_a*1000)/J #tou = Tc/J
c_b = 15 #mm
tou_b = (T3*c_b*1000)/J #tou = Tc/J

#Display
print'The shear stress developed at A   = ',round(tou_a*10,1),"ksi"
print'The shear stress developed at B   = ',round(tou_b*10,2),"ksi"

The shear stress developed at A   =  18.9 ksi
The shear stress developed at B   =  3.77 ksi


## Example 5.3 Page No 189¶

In :
#Given
di = 80             #mm, inside diameter
ri = 40/1000.0      #m, inside radius
d0 = 100            #mm, outside diameter
ro = d0/2000.0      #m outside radius
F = 80              #N, force
l1 = 0.2            #m, length
l2 = 0.3            #m

#Internal Torque
T = F*(l1+l2)
#Section Property
import math
J = (math.pi/2.0)*((ro**4)-(ri**4))
#Shear Stress
c_o = 0.05#m
tou_o = (T*c_o)/(J*10**6)
c_i = 0.04 #m
tou_i = (T*c_i)/(J*10**6)

#Display
print'The shear stress in the inner wall    = ',round(tou_i,3),"MPa"
print'The shear stress in the outer wall    = ',round(tou_o,3),"MPa"

The shear stress in the inner wall    =  0.276 MPa
The shear stress in the outer wall    =  0.345 MPa


## Example 5.4 Page No 191¶

In :
#Given
P = 5          #hp
N = 175           #rpm
allow_shear = 14.5 #ksi

#Calculations
import math
P_=P*550       #ftlb/s
T = P_/ang_vel #P = T*angular velocity
c = ((2*T*12)/(math.pi*allow_shear*1000))**(1/3.0)
d =2*c

#Display
print'The required diameter of the shaft   = ',round(d,3),"inch"

The required diameter of the shaft   =  0.858 inch


## Example 5.5 Page No 205¶

In :
#Given
E = 80*10**9       #N/m**2, longitudinal stress
d = 14/1000.0         #m,  diameter
R = 100             #mm
l_ac = 0.4           #m, length
l_cd = 0.3           #m
l_de = 0.5          #m
T_c = 280          #Nm, torque
T_a = 150           #Nm
T_d = 40             #Nm
T_ac = T_a           #Nm

#Calculation
T_cd = T_ac - T_c
T_de = T_cd - T_d
#Angle of Twist
import math
J = (math.pi/2.0)*(r**4)
phiA=T_ac*l_ac/(J*E)+T_cd*l_cd/(J*E)+T_de*l_de/(J*E)
Sp=phiA*R

#Display
print'The angle of twist of the shaft       = ',round(phiA,3),"rad"
print'The displacement of tooth P on gear A    =',round(Sp,3),"mm"

The angle of twist of the shaft       =  -0.212 rad
The displacement of tooth P on gear A    = -21.212 mm


## Example 5.6 Page No 206¶

In :
#Given
T = 45		 #N, torque
G = 80 		#GPa, pressure
d = 20/1000.0		 #m
r = d/2.0	 #m
l_dc = 1.5		 #m
l_ab = 2 		#m
r1 = 75/1000.0		 #m
r2 = 150/1000.0		 #m

#Calculation
#Internal Torque
F = T/r2
T_d_x = F*r1
#Angle of twist
import math
J = (math.pi/2)*(r**4)
phi_c = (T*l_dc)/(2*J*G*10**9)
phi_b = (phi_c*r1)/r2
phi_ab = (T*l_ab)/(J*G*10**9)
phi_a = phi_b + phi_ab

#Display
print'The angle of twist of end A of shaft AB   = ',round(phi_a,3),"rad"

The angle of twist of end A of shaft AB   =  0.085 rad


## Example 5.7 Page No 207¶

In :
#Given
d = 2            #inch, diameter
c = d/2.0
l_buried = 600		 #mm, buried length
G = 5500*10**3 		#MPa
F = 1     		#N
l_handle= 150 		#mm
l_ab = 36 		#inch

#Internal Torque
T_ab = F*2*l_handle
t = T_ab/l_buried
#Maximum Shear Stress
import math
J = (math.pi/2.0)*(r**4)
tou_max = (T_ab*c)/(J)

#Angle of Twist
from scipy import integrate
def f(x):
return(x)
x=integrate.quad(f,0,24) #Strain formula for short line segment = delta(sdash) =(1+e_z)delta(s)
X= x
phi_a = ((T_ab*l_ab)+(50*X/4.0))/(J*G)

#Display
print'The maximum shear stress in the post          =',round(tou_max,1),"psi"
print'The angle of twist at the top of the post    = ',round(phi_a,5),"rad"

The maximum shear stress in the post          = 191.0 psi
The angle of twist at the top of the post    =  0.00167 rad


## Example 5.8 Page No 216¶

In :
#Given
d = 20/1000.0 #m, diameter
r = d/2.0
l_bc = 0.2
l_cd = 1.5
l_da = 0.3
T_c = 800  #Nm, torque
T_d = -500 #Nm

#Calculation
#Eqn 1      300 = T_a + T_b
#Compatibility
#Eqn 2
coeff_Tb = -l_bc
coeff_Ta = l_cd + l_da
#Solving Equations simultaneously using matrices
T_b = 645
T_a = -345

#Display
print'The reaction at A    = ',T_a,"Nm"
print'The reaction at B    = ',T_b,"Nm"

The reaction at A    =  -345 Nm
The reaction at B    =  645 Nm


## Example 5.9 Page No 217¶

In :
#Given
T = 250         #Nm, torque
G_st = 80        #GPa, pressure
G_br = 36        #GPa
ri = 0.5         #inch, inside radius
ro = 1         #inch, outside radius
l_ab = 1.2      #m

#Equilibrium
# -Tst-Tbr+250Nm = 0
coeff1_st = -1
coeff1_br = -1
b1 = -250

#Compatibility
#phi = TL/JG
import math
J1 = (math.pi/2.0)*(ro**4 - ri**4)
J2 = (math.pi/2.0)*(ri**4)
coeff2_st = 1/(J1*G_st*10**3)
coeff2_br = -1/(J2*G_br*10**3)
b2 = 0

#Solving the above two equations simultaneously using matrices
T_st = 2911.5       #lb-inch
T_br = 88.5         #lb-inch

shear_br_max = (T_br*10**3*ri)/(J2) #tou = (Tr)/J
shear_st_min = (T_st*10**3*ri)/(J1) #tou = (Tr)/J
shear_st_max = (T_st*10**3*ro)/(J1) #tou = (Tr)/J

shear_strain = shear_br_max / G_br
shear_strain = shear_strain

#Display
print'The maximum shear stress experienced by Steel =',round(shear_st_max/1000),"psi"
print'The minimum shear stress experienced by Steel =',round(shear_st_min/1000),"psi"
print'The maximum shear stress experienced by Brass  ',round(shear_br_max/1000),"psi"

The maximum shear stress experienced by Steel = 1977.0 psi
The minimum shear stress experienced by Steel = 989.0 psi
The maximum shear stress experienced by Brass   451.0 psi


## Example 5.10 Page No 223¶

In :
#Given
import math
l = 4*12            #m, length
a = 1.5             #inch
tou_allow = 8000     #lb
G = 3.7*10**6      #lb/inch**2, pressure
alpha = (60*math.pi)/180.0 #degrees

#Calculations
T_shear1 = (tou_allow*a**3)/(20.0) # allowable shear stress = (20T)/(a**3)
T_twist1 = (phi_allow*a**4*G)/(46*l) #angle of twist =(46TL)/(a**4*G)
T1 = min(T_shear1, T_twist1)

#Circular Cross Section
c_ = (a*a*math.sin(alpha))/(math.pi*2)
c = math.sqrt(c_)

J = (math.pi/2.0)*(c**4)
T_shear2 = (tou_allow*J)/(c*1000)
T_twist2 = (phi_allow*J*G*10**3)/(l*10**6)
T2 = min(T_shear2, T_twist2)

#Display
print'The largest torque that applied at the end of the triangular shaft  ',round(T1,0),"lb-in"
print'The largest torque that applied at the end of the circular shaft    ',round(T2*1000,0),"lb-in"

The largest torque that applied at the end of the triangular shaft   170.0 lb-in
The largest torque that applied at the end of the circular shaft     233.0 lb-in


## Example 5.12 Page No 228¶

In :
#Given
#The given dimension are
l_cd = 0.5       #m
l_de = 1.5       #m
h =60/1000.0     #m
w = 40/1000.0    #m
t_h = 3/1000.0   #m
t_w = 5/1000.0  #m
T_c = 60        #Nm
T_d = 25         #Nm
G = 38*10**9 #N/m**2
T1 = T_c - T_d

#Calculation
#Average Shear Stress
area = (w-t_w)*(h-t_h)
shear_a = T1/(2*t_w*area*10**6)
shear_b = T1/(2*t_h*area*10**6)

#Angle of Twist
phi=(T_c*l_cd/(4*area**2*G))*((2*57/5.0)+(2*35/3.0))+(T1*l_de/(4*area**2*G))*((2*57/5.0)+(2*35/3.0))

#Display
print'The average shear stress of the tube at A    = ',round(shear_a,2),"MPa"
print'The average shear stress of the tube at B    = ',round(shear_b,2),"MPa"
print'The angle of twist of end C                  = ',round(phi,5),"rad"

The average shear stress of the tube at A    =  1.75 MPa
The average shear stress of the tube at B    =  2.92 MPa
The angle of twist of end C                  =  0.00629 rad


## Example 5.13 Page No 236¶

In :
#Given
fillet_r = 6 #mm, fillet radius
D = 40/1000.0 #m, diameter
d = 20/1000.0 #m
T = 30 #Nm

#Calculation
D_d = D/d
r_d = fillet_r/d
k = 1.3
#Maximum Shear Stress
import math
c = D/2.0
J = (math.pi/2.0)*(c**4)
max_shear = (k*T*c)/(J*10**6) # tou = K(Tc/J)

#Display
print'The maximum shear stress in the shaft is  = ',round(max_shear,1),"MPa"

The maximum shear stress in the shaft is  =  3.1 MPa


## Example 5.14 Page No 242¶

In :
#Given
ro = 50/1000.0     #m, outside radius
ri = 30/1000.0     #m inside radius
c = ro
shear = 20*10**6 #N/m**2

#Maximum Elastic Torque
import math
J = (math.pi/2.0)*((ro**4)-(ri**4))
T_y = (shear*J)/c # tou = Tc/J
T_y = T_y/1000.0 #in kN

#Plastic Torque
x0 = 0.03
x1 = 0.05

from scipy import integrate
def f(rho):
return(rho**2)
I=integrate.quad(f,x0,x1) #Strain formula for short line segment = delta(sdash) =(1+e_z)delta(s)

Tp =(2*math.pi*I*shear)
Tp_= Tp/1000.0
#Outer Shear Strain
strain = (0.286*10**-3*ro)/(ri)

#Display
print'The maximum torque that can be applied to the shaft ',round(T_y,2),"kNm"
print'The plastic torque that can be applied to the shaft',round(Tp_,2),"kNm"
print'The minimum shear strain at the outer radius of the shaft  ',round(strain,6),"rad"

The maximum torque that can be applied to the shaft  3.42 kNm
The plastic torque that can be applied to the shaft 4.11 kNm
The minimum shear strain at the outer radius of the shaft   0.000477 rad


## Example 5.15 Page No 243¶

In :
#Given
l = 1.5          #m, length
shear_y = 75*10**6 #N/m**2

#Calculations
max_shear_strain = (phi*r)/(l) #phi = (strain*L)/r
strain_y = 0.0016
r_y = (r*strain_y)/(max_shear_strain) #by ratios
#T= (math.pi*shear_y)*(4c**3 - r_y**3)/6.0
import math
c = r
T = (math.pi*shear_y)*(4*c**3 - r_y**3)/6.0
T = T/1000.0

#Display
print'The torque needed to twist the shaft by 0.6 rad   ',T,"kNm"

The torque needed to twist the shaft by 0.6 rad    1.25412378731 kNm


## Example 5.16 Page No 244¶

In :
#Given
l = 5            #m, length
G = 12*10**3     #GPa
co = 2          #inch
ci = 1          #inch
shear_y = 12      #N/mm**2

#Plastic Torque
import math
T_p = ((2*math.pi)*(co**3 - ci**3)*shear_y)/3.0
phi_p = (strain_y*l*shear_y)/ci
J = (math.pi/2.0)*(co**4 - ci**4)
shear_r = (T_p*co)/J
shear_i = (shear_r*ci)/(co)# shear = Tc/J
G = shear_y/strain_y
phi_dash = (T_p*l*10**3)/(J*G) #phi = TpL/JG
phi = phi_p - phi_dash

#Display
print'The plastic torque Tp   =  ',round(T_p,1),"kip in"
print'shear stress at inner wall is  ',round(shear_i,2),"ksi"

The plastic torque Tp   =   175.9 kip in
shear stress at inner wall is   7.47 ksi