example 11.2 page number 352¶

In [1]:
from math import sqrt,pi

#A material has strength in tension, compression and shear as 30N/mm2, 90 N/mm2 and 25 N/mm2, respectively. If a specimen of diameter 25 mm is tested in tension and compression identity the failure surfaces and loads.

#variable declaration

#In tension: Let axial direction be x direction. Since it is uniaxial loading, py  = 0, q = 0 and only px exists.when the material is subjected to full tensile stress, px = 30 N/mm^2.

pt=float(30)
pc=float(90)
ps=float(25)

d=float(25)
px=float(30)         #N/mm^2
py=0
q=0
p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))

p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))

qmax=(px-py)/2

#Hence failure criteria is normal stress p1

A=pi*pow(d,2)/4

#Corresponding load P is obtained by
p=p1
P=p1*A

print "(a) P=",round(P,2),"N"

#In case of compression test,

px=-pc
py=q=0

P=-px*A

print "(b) P=",round((-P),2),"N compressive"

#at this stage

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print "Material fails because of maximum shear and not by axial compression."
qmax=25
px=2*qmax

P=px*A
print"P=",round(P),"N"
print "The plane of qmax is at 45° to the plane of px. "

(a) P= 14726.22 N
(b) P= -44178.65 N compressive
Material fails because of maximum shear and not by axial compression.
P= 24544.0 N
The plane of qmax is at 45° to the plane of px.


example 11.3 page number 354¶

In [2]:
#The direct stresses at a point in the strained material are 120 N/mm2 compressive and 80 N/mm2 tensile. There is no shear stress.

from math import sqrt,cos,sin,atan,pi
#variable declaration

#The plane AC makes 30° (anticlockwise) to the plane of px (y-axis). Hence theta= 30°. px = 80 N/mm^2 py = – 120 N/mm^2 ,q = 0

px=float(80)
py=float(-120)
q=float(0)
theta=30
pn=((px+py)/2)+((px-py)/2)*cos(2*theta*pi/180)+q*sin(2*theta*pi/180)

print"pn=",round(pn),"N/mm^2"

pt=((px-py)/2)*sin(2*theta*pi/180)-q*cos(2*theta*pi/180)

print"pt=",round(pt,1),"N/mm^2"
p=sqrt(pow(pn,2)+pow(pt,2))

print"p=",round(p,2),"N/mm^2"

alpha=atan(pn/pt)*180/pi

print "alpha=", round(alpha,1),"°"

pn= 30.0 N/mm^2
pt= 86.6 N/mm^2
p= 91.65 N/mm^2
alpha= 19.1 °


example 11.4 page number 355¶

In [3]:
from math import sqrt,cos,sin,atan,pi
#variable declaration
#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then

px=float(200)                    #N/mm^2
py=float(150)                    #N/mm^2
q=float(100)                     #N/mm^2

theta1=(atan((2*q)/(px-py))*180)/(pi*2)
theta2=90+theta1
print"theta=",round(theta1,2),"°" " and ",round(theta2,2),"°"

p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p1=",round(p1,2),"N/mm^2"

p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p2=",round(p2,2),"N/mm^2"

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print"qmax=",round(qmax,2),"N/mm^2"

theta= 37.98 ° and  127.98 °
p1= 278.08 N/mm^2
p2= 71.92 N/mm^2
qmax= 103.08 N/mm^2


example 11.5 page number 356¶

In [4]:
from math import sqrt,cos,sin,atan,pi
#variable declaration
#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then

px=float(80)                    #N/mm^2
py=float(-60)                    #N/mm^2
q=float(20)                     #N/mm^2

p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p1=",round(p1,2),"N/mm^2"

p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p2=",round(p2,2),"N/mm^2"

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print"qmax=",round(qmax,2),"N/mm^2"

#let theta be the inclination of principal stress to the plane of px.

theta1=(atan((2*q)/(px-py))*180)/(pi*2)
theta2=90+theta1
print"theta=",round(theta1,2),"°" " and ",round(theta2,2),"°"

#Planes of maximum shear make 45° to the above planes.
theta11=45-theta1
theta22=theta2-45
print"theta'=",round(theta11,2),"°","and=",round(theta22,2),"°"


p1= 82.8 N/mm^2
p2= -62.8 N/mm^2
qmax= 72.8 N/mm^2
theta= 7.97 ° and  97.97 °
theta'= 37.03 ° and= 52.97 °


example 11.6 page number 357¶

In [5]:
from math import sqrt,cos,sin,atan,pi
#variable declaration
#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then

px=float(-100)                    #N/mm^2
py=float(-75)                    #N/mm^2
q=float(-50)                     #N/mm^2

p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p1=",round(p1,2),"N/mm^2"

p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p2=",round(p2,2),"N/mm^2"

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print"qmax=",round(qmax,2),"N/mm^2"

#let theta be the inclination of principal stress to the plane of px.

theta1=(atan((2*q)/(px-py))*180)/(pi*2)
theta2=90+theta1
print"theta=",round(theta1,2),"°" " and ",round(theta2,2),"°"

p1= -35.96 N/mm^2
p2= -139.04 N/mm^2
qmax= 51.54 N/mm^2
theta= 37.98 ° and  127.98 °


example 11.7 page number 358¶

In [6]:
from math import sqrt,cos,sin,atan,pi
#variable declaration
#Let the principal plane make anticlockwise angle theta with the plane of px with y-axis. Then

px=float(-50)                    #N/mm^2
py=float(100)                    #N/mm^2
q=float(75)                     #N/mm^2

p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))

print "(i) p1=",round(p1,2),"N/mm^2"

p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))

print "p2=",round(p2,2),"N/mm^2"

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print"(ii) qmax=",round(qmax,2),"N/mm^2"

#let theta be the inclination of principal stress to the plane of px.

theta1=(atan((2*q)/(px-py))*180)/(pi*2)

print"theta=",round(theta1,2),"°" " clockwise"

#Plane of maximum shear makes 45° to it

theta2=theta1+45
print"theta2=",round(theta2,2),"°"

#Normal stress on this plane is given by

pn=((px+py)/2)+((px-py)/2)*cos(2*theta2*pi/180)+q*sin(2*theta2*pi/180)

pt=qmax

#Resultant stress
p=sqrt(pow(pn,2)+pow(pt,2))

print "p=",round(p,2),"N/mm^2"

#Let ‘p’ make angle phi to tangential stress (maximum shear stress plane).

phi=atan(pn/pt)*180/pi

print "phi=",round(phi,1),"°"

#there is mistake in book
print"mitake in book answer is wrong"

(i) p1= 131.07 N/mm^2
p2= -81.07 N/mm^2
(ii) qmax= 106.07 N/mm^2
theta= -22.5 ° clockwise
theta2= 22.5 °
p= 108.97 N/mm^2
phi= 13.3 °
mitake in book answer is wrong


example 11.9 page number 361¶

In [7]:
from math import sqrt

#variable declaration

w=float(100)                   #wide of rectangular beam,mm
h=float(200)                   #height or rectangular beam dude,mm

I=w*pow(h,3)/12

#At point A, which is at 30 mm below top fibre
y=100-30
M=float(80*1000000)            #sagging moment,KN-m

fx=M*y/I

px=-fx
F=float(100*1000 )            #shear force,N
b=float(100)
A=b*30
y1=100-15

q=(F*(A*y1))/(b*I)     #shearing stress,N/mm^2

py=0
p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))
p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))
print " p1=",round(p1,2),"N/mm^2"
print " p2=",round(p2,2),"N/mm^2"

 p1= 0.17 N/mm^2
p2= -84.17 N/mm^2


example 11.10 page number 362¶

In [8]:
from math import sqrt,atan

Ra=(P1+P2+P3)/2              #Due to symmetry

Rb=Ra
#At section 1.5 m from A
F=(Ra-P1)*1000
M=float((Ra*1.5-P1*0.5)*1000000)
b=float(100)
h=float(180)

I=float((b*pow(h,3))/12)

# Bending stress
#f=M*y/I
y11=0
f1=(-1)*M*y11/I
y22=45
f2=(-1)*M*y22/I
y33=90
f3=(-1)*M*y33/I
#Shearing stress at a fibre ‘y’ above N–A is
#q=(F/(b*I))*(A*y1)
#at y=0,
y1=45
A1=b*90
q1=(F/(b*I))*(A1*y1)
#at y=45
y2=float(90-45/2)
A2=b*45
q2=(F/(b*I))*(A2*y2)
#at y=90
q3=0

#(a) At neutral axis (y = 0) : The element is under pure shear

py=0

p1=(f1+py)/2+sqrt(pow(((f1-py)/2),2)+pow(q1,2))

p2=(f1+py)/2-sqrt(pow(((f1-py)/2),2)+pow(q1,2))
print "(i) p1=",round(p1,4),"N/mm^2"
print " p2=",round(p2,4),"N/mm^2"

theta1=45
theta2=theta1+90
print"theta=",round(theta1),"°"," and ",round(theta2),"°"

#(b) At (y = 45)
py=0

p1=(f2+py)/2+sqrt(pow(((f2-py)/2),2)+pow(q2,2))

p2=(f2+py)/2-sqrt(pow(((f2-py)/2),2)+pow(q2,2))
print "(ii) p1=",round(p1,4),"N/mm^2"
print " p2=",round(p2,4),"N/mm^2"

thetab1=(atan((2*q2)/(f2-py))*180)/(pi*2)
thetab2=thetab1+90
print"theta=",round(thetab1),"°"," and ",round(thetab2),"°"
#mistake in book
print"mistake in book"

#(c) At Y=90

py=0

p1=(f3+py)/2+sqrt(pow(((f3-py)/2),2)+pow(q3,2))

p2=(f3+py)/2-sqrt(pow(((f3-py)/2),2)+pow(q3,2))
print "(iii) p1=",round(p1,4),"N/mm^2"
print " p2=",round(p2,4),"N/mm^2"

thetac1=(atan((2*q3)/(f3-py))*180)/(pi*2)
thetac2=thetac1+90
print"theta=",round(thetac1),"°"," and ",round(thetac2),"°"

(i) p1= 0.8333 N/mm^2
p2= -0.8333 N/mm^2
theta= 45.0 °  and  135.0 °
(ii) p1= 0.0122 N/mm^2
p2= -32.4196 N/mm^2
theta= -1.0 °  and  89.0 °
mistake in book
(iii) p1= 0.0 N/mm^2
p2= -64.8148 N/mm^2
theta= -0.0 °  and  90.0 °


example 11.11 page number 364¶

In [9]:
from math import sqrt

#variable declaration
L=float(6)                     #m
Rs=L*w/2                       #Reaction at support,KN

#Moment at 1.5 m from support
M =float( Rs*1.5-(w*pow(1.5,2)/2))
#Shear force at 1.5 m from support
F=Rs-1.5*w

B=float(200)                   #width of I-beam,mm
H=float(400)                   #height or I-beam,mm
b=float(190)
h=float(380)
I= (B*pow(H,3)/12)-(b*pow(h,3)/12)

#Bending stress at 100 mm above N–A
y=100

f=M*1000000*y/I

#Thus the state of stress on an element at y = 100 mm, as px = f,py=0
px=-f
py=0
A=200*10*195+10*90*145
q=(F*1000*(A))/(10*I)     #shearing stress,N/mm^2

p1=(px+py)/2+sqrt(pow(((px-py)/2),2)+pow(q,2))
p2=(px+py)/2-sqrt(pow(((px-py)/2),2)+pow(q,2))
print " p1=",round(p1,2),"N/mm^2"
print " p2=",round(p2,2),"N/mm^2"

qmax=sqrt((pow((px-py)/2,2))+pow(q,2))

print"qmax=",round(qmax,2),"N/mm^2"

 p1= 5.21 N/mm^2
p2= -107.56 N/mm^2
qmax= 56.38 N/mm^2