# Chapter5-Bending of Beams¶

## Ex1-pg128¶

In [3]:
import math
#calculate meter and sigma
Mz=11000. ##Nm
A1=0.13*0.02 ##m
A2=0.15*0.02 ##m
z1=0.01 ##m
z2=0.075 ##m
yA=0.043 ##m
zA=-0.106 ##m
yB=-0.063 ##m
zB=0.

##location of the centroid
z=(A1*z1+A2*z2)/(A1+A2)
print'%s %.2f %s'%("in meter is= ",z,"")

Iz=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3.)/12.+ (0.15*0.02*(0.035)**2.)
print'%s %.5f %s'%("Iz in meter^4 is= ",Iz,"")
Iy=(0.02*(0.13)**3)/12.+ (0.13*0.02*(0.04)**2)+(0.15*(0.02)**3)/.12+ (0.15*0.02*(0.035)**2.)
print'%s %.5f %s'%("Iy in meter^4 is= ",Iy,"")
Iyz=0+A1*0.04*(-0.035)+0+A2*(-0.035)*0.03
print'%s %.2f %s'%("Iyz in meter^4 is= ",Iyz,"")
##thetap=(atand((-2*Iyz)/(Iz-Iy)))/2
##print'%s %.2f %s'%(thetap)
I1=(Iz+math.sqrt(0.+(6.79*10**-6)**2.))
print'%s %.5f %s'%("I1 in meter^4 is= ",I1,"")
I2=(Iz-math.sqrt(0+(6.79*10**-6)**2))
print'%s %.6f %s'%("I2 in meter^4 is= ",I2,"")
My1=11000.*math.sin(45/57.3)
print'%s %.2f %s'%("My1 in Nm is",My1,"")
Mz1=11000*math.sin(45/57.3)
print'%s %.2f %s'%("Mz1 in Nm is",Mz1,"")

sigmaxA=((My1*(zA))/I1)-((Mz1*yA)/I2)
print'%s %.2f %s'%("sigmaxA in MPa is",sigmaxA,"")
sigmaxB=0-((My1*yB)/I2)
print'%s %.2f %s'%("sigmaxB in MPa is",sigmaxB,"")

My=0.
y=((Mz*Iyz)*z)/(Mz*Iy) ##.......equal to z=-1.71y
print'%s %.3f %s'%("y",y,"")

in meter is=  0.04
Iz in meter^4 is=  0.00001
Iy in meter^4 is=  0.00002
Iyz in meter^4 is=  -0.00
I1 in meter^4 is=  0.00002
I2 in meter^4 is=  0.000005
My1 in Nm is 7777.72
Mz1 in Nm is 7777.72
sigmaxA in MPa is -114417761.50
sigmaxB in MPa is 101941050.82
y -0.014


## Ex4-144¶

In [2]:
import math
#calculate the distance
import scipy
from scipy import integrate
t=1.25 ##mm
y=15.87 ##mm
z=5.28 ##mm
Iy=4765.62 ##mm**4
Iz=21054.69 ##mm**4
Iyz=3984.37 ##mm**4
thetap=13.05 ##degree
Iy1=3828.12 ##mm**4
Iz1=21953.12##mm**4
s=12.5

##tau=(Vy/Iz1*t)*s*t(19.55+s*asind(13.05)/2)....equation 1
##F1=integrate((tau*t)ds)
def fun(s):
y=(0)
return y
x=x[0]
##F1=0.0912*Vy1                   substituting the value of tau we get F1
##Vy1*ez1=37.5*F1                 substituting the value of F1 we get ez1
ez1=37.5*0.0912
print'%s %.2f %s'%("the distance in mm is= ",ez1,"")

##tau=(Vz1/Iy1*t)*s*t(12.05-s*asind(13.05)/2)....equation 2
##F1=integrate((tau*t)ds)
def fun(s):
y=(0)
return y
x=x[0]

##F1=0.204*Vz1                   substituting the value of tau we get F1
##Vz1*ey1=37.5*F1                 substituting the value of F1 we get ez1
ey1=37.5*0.204
print'%s %.2f %s'%("the distance in mm is= ",ey1,"")

the distance in mm is=  3.42
the distance in mm is=  7.65


## Ex5-pg154¶

In [1]:
import math
#calculate stress and meter
import scipy
from scipy import integrate
P=70. ##kN
c=0.05##m
c1=c
c2=c
R=0.1+0.05
A=0.005

##m=(-1/(2*c))*integrate((y/R+y)dy)
def fun(c):
y=(-c)
return y

m=-1.+(R/2.*c)*math.log((R+c)/(R-c))
print'%s %.2f %s'%("m",m,"")
##m=(-1/(2*c))*integrate((y/R)-(y**2/R**2)+(y**3/R**3)-(y**4/R**4)+.....)dy)
m=-1+(3/2.)*math.log(2.)
print'%s %.3f %s'%("m",m,"")

M=P*R
print'%s %.2f %s'%("M",M,"")
sigmatheta1=(-P*c2)/(m*A*(R-c1))
print'%s %.2f %s'%("stress in Pa is= ",sigmatheta1,"")
sigmatheta2=(P*c2)/(m*A*(R+c2))
print'%s %.2f %s'%("stress in Pa is= ",sigmatheta2,"")

m -1.00
m 0.040
M 10.50
stress in Pa is=  -176230.22
stress in Pa is=  88115.11