# Chapter 18: Torsion of Beams¶

## Example 18.1 Pg.No.527¶

In :
from __future__ import division
import math

#variable declaration
l=2*10**3                #length of cylinder (mm)
torque=30*10**6           #torque at mid point (N.mm)
Tmax=15*10**6
Tau_max=200               #max shear stress (N/mm^2)
G=25000                   #shear modulus (N/mm^2)
theta =2                # rotation at mid point (degree)

#ref equation 18.1    T=2Aq
tmin1=Tmax/(2*math.pi*r**2*Tau_max)
print "\nminimum thickness of beam due to stress limited to 200N/mm^2 = %3.1f mm"%(tmin1)

z=1*10**3                   # twist at mid point (mm)
#equation 18.4 after integration
tmin2=Tmax*200*math.pi*z/(4*(math.pi*r**2)**2*G*theta*math.pi/180)
print "\nminimum thickness due to constraint on maximum angle twist = %3.1f mm"%(tmin2)
t=max(tmin1,tmin2)
print "\nthickness which satisfies both conditions = %3.1f mm"%(t)

minimum thickness of beam due to stress limited to 200N/mm^2 = 1.2 mm

minimum thickness due to constraint on maximum angle twist = 2.7 mm

thickness which satisfies both conditions = 2.7 mm


## Example 18.3 Pg.No 540¶

In :
#reference Fig 18.12
from __future__ import division
import math
from sympy import symbols
from sympy import integrate

S1,S2,S3=symbols('S1,S2,S3')

#variable declaration
s1=50             #length of channel (mm)
s2=25             #width of channel (mm)
t1=2.5            #thickness of web(mm)
t2=1.5             #thickness of flange(mm)
T=10*10**3         #torque applied (N.mm)
zeta_s=8.04
G=25000             #shear modulus (N/mm^2)

#J=Sum(st^3/3)
J=1/3*(s1*t1**3+2*s2*t2**3)
tau_max=t1*T/J
print "maximum shear stress = %3.1f N/mm^2"%(tau_max)

#in region O2
s1=25
ARf=1/2*zeta_s*s1
ws=-2*ARf*T/(G*J)
print "warping in O2 region is linear = %3.2f mm"%(ws)

#in the wall 21
AR=1/2*zeta_s*s2-0.5*25*s2
w21=-0.03*(zeta_s-s2)
s1=50
tds=2*s2*t2+s1*t1

A12=25/2*S1
A23=312.5-4.02*S2
A34=111.5+25/2*S3
AR1=1/2*(integrate(A12,(S1,0,25))+integrate(5*(A23),(S2,0,50))+integrate(3*A34,(S3,0,25)))/200

#equation 18.20
ws=-2*ARf*T/G/J
print "warping distribution in flange 34 = %1.2f \n"%(ws)

maximum shear stress = 78.9 N/mm^2
warping in O2 region is linear = -0.25 mm
warping distribution in flange 34 = -0.25


In [ ]: