# Chapter6-Torsion of Prismatic Bars¶

## Ex2-177¶

In [1]:
import math
#calculate applied torque and shearing stress and angle of twist per unit length
G=28. ##GPa
t1=0.012
t2=0.006
t3=0.01
t4=0.006
A=0.125
h=226000. ##N/m
Mt=2.*A*h
print'%s %.2f %s'%("applied torque in Nm is=",Mt,"")

tau1=(h/t1)
print'%s %.2f %s'%("shearing stress in Pa is= ",tau1,"")
tau2=(h/t2)
print'%s %.2f %s'%("shearing stress in Pa is= ",tau2,"")
tau3=(h/t3)
print'%s %.2f %s'%("shearing stress in Pa is= ",tau3,"")
tau4=(h/t4)
print'%s %.2f %s'%("shearing stress in Pa is= ",tau4,"")

##theta=(h/2*G*A)intc((1/t)ds)
theta=(h/(2*G*10**9*A))*((0.25/t1)+2*(0.5/t2)+(0.25/t3))
print'%s %.4f %s'%("angle of twist per unit length in rad/m is= ",theta,"")

applied torque in Nm is= 56500.00
shearing stress in Pa is=  18833333.33
shearing stress in Pa is=  37666666.67
shearing stress in Pa is=  22600000.00
shearing stress in Pa is=  37666666.67
angle of twist per unit length in rad/m is=  0.0069


## Ex4-pg185¶

In [3]:
import math
#calculate torsional rigidity of the beam and maxi longitudinal bending stress in the flange and total angle of twist
G=80. ##GPa
E=200. ##GPa
tf=10. ##mm
tw=0.007 ##m
t1=tw
t2=0.01
h=0.2 ##m
b=0.1 ##m
b2=b
b1=0.19
L=2.4 ##m
If=0.01*0.1**3
Mt=1200.
L=2.4

##solution a:
##C=Mt/theta
##C=(b1*t1**3+2*b2*t2**3)*(G/3)
C=((b1*t1**3.+2.*b2*t2**3)/3.)##    without substituting the value of G we get C
print'%s %.8f %s'%("torsional rigidity of the beam is= ",C,"")

##a=(If*E)/12
a=If/12.##                 without substituting the value of E we get a
print(a)
##alpha=1/(h*sqrt((E*If)/(2*C)))
y=math.sqrt((2.5*a)/(2.*C))##   without substituting the value of h
print(y)
##(1/alpha)==y
##sigmafmax=(Mfmax*x)/If
sigmafmax=(3.43*Mt*0.05)/a
print'%s %.2f %s'%("maxi longitudinal bending stress in the flange in MPa is= ",sigmafmax,"")

##soluton b:
si=(Mt/(C*G*10**9))*(L-y*h)
print'%s %.2f %s'%("the angle of twist at the free end in radian is =",si,"")
si1=(Mt*L)/(C*G*10**9.)
print'%s %.2f %s'%("total angle of twist in radians is= ",si1,"")

torsional rigidity of the beam is=  0.00000009
8.33333333333e-07
3.43291315217
maxi longitudinal bending stress in the flange in MPa is=  246960000.00
the angle of twist at the free end in radian is = 0.29
total angle of twist in radians is=  0.41