# example 10.1 page number 319¶

In :
#variable declaration

#A simply supported beam of span 3.0 m has a cross-section 120 mm × 180 mm. If the permissible stress in the material of the beam is 10 N/mm^2

b=float(120)
d=float(180)

#I=(b*d^3)/12,Ymax=d/2

Z=(b*pow(d,2))/6
fper=float(10)

L=3
Mmax=fper*Z

#Let maximum udl beam can carry be w/metre length
#In this case, we know that maximum moment occurs at mid span and is equal to Mmax = (wL^2)/8

w=(Mmax*8)/(pow(L,2)*1000000)

print "(i) w=",round(w,2),"KN/m"

# Concentrated load at distance 1 m from the support be P kN.

a=float(1)           #distance of point at which load is applied from left,m
b=float(2)           #distance of point at which load is applied from right,m

P=(L*Mmax)/(a*b*1000000)

print "(ii) P=",round(P,2),"KN"

(i) w= 5.76 KN/m
(ii) P= 9.72 KN


# example 10.2 page number 320¶

In :
from math import pi

#variable declaration

#A circular steel pipe of external diameter 60 mm and thickness 8 mm is used as a simply supported beam over an effective span of 2 m. If permissible stress in steel is 150 N/mm^2,

D=float(60)            #external diameter,mm
d=float(44)             #Thickness,mm

I=(pi*(pow(D,4)-pow(d,4)))/64         #Area moment of inertia,mm^4
Ymax=float(30)                       #extreme fibre distance,mm

Z=I/Ymax
fper=float(150)

Mmax=fper*Z

#Let maximum load it can carry be P kN.
L=float(2)
P=(4*Mmax)/(L*1000000)

print " P=",round(P,2),"KN"

 P= 4.52 KN


# example10.3 page number 321¶

In :
#the cross-section of a cantilever beam of 2.5 m span. Material used is steel for which maximum permissible stress is 150 N/mm^2

#variable declaration

A=float(180)               #width of I-beam,mm
H=float(400)               #height of I-beam,mm
a=float(170)               #width of inter rectancle if I-beam consider as Rectangle with width 10,mm
h=float(380)               #Height of inter rectancle if I-beam consider as Rectangle with width 10,mm

I=((A*pow(H,3))/12)-((a*pow(h,3))/12)
ymax=float(200)            #extreme fibre,mm

Z=I/ymax
fper=float(150)

Mmax=fper*Z

#If udl is w kN/m, maximum moment in cantilever

L=2  #m

w=Mmax/(L*1000000)
print "w=",round(w,2),"KN/m"

w= 68.49 KN/m


# example10.4 page number 323¶

In :
#Compare the moment carrying capacity of the section given in example 10.3 with equivalent section of the same area but (i) square section (ii) rectangular section with depth twice the width and (iii) a circular section.

from math import sqrt,pi
#variable declaration

A=180.0*10.0+380.0*10.0+180.0*10.0

#If ‘a’ is the size of the equivalent square section,

a=float(sqrt(A))       #mm

I=(a*pow(a,3))/12  #Moment of inertia of this section, mm^4

ymax=a/2

Z=I/ymax

f=150.0

Mcc=f*Z          #Moment carrying capacity

MccI=136985000.0

Ratio=MccI/Mcc
print "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=",round(Ratio,3)

#Equivalent rectangular section of depth twice the width. Let b be the width,Depth d = 2b. Equating its area to area of I-section,we get
b=sqrt(7400/2)

ymax=b

I=b*(pow((2*b),3))/12

M=f*I/ymax

MccI=136985000

Ratio=MccI/M
print "(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection=",round(Ratio,3)

#Equivalent circular section. Let diameter be d.

d=sqrt(7400*4/pi)

I=(pi*pow(d,4))/64
ymax=d/2
Z=I/ymax
fper=float(150)
M=fper*Z

MccI=136985000

Ratio=MccI/M
print "(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection=",round(Ratio,3)

(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 8.608
(ii) Moment carryingcapacity of I-section/ Moment carryingcapacityof equivalent squaresection= 6.087
(i) Moment carryingcapacity of Isection/ Moment carryingcapacityof equivalent squaresection= 10.171


# example10.5 page number 324¶

In :
#variable declaration

#A symmetric I-section of size 180 mm × 40 mm, 8 mm thick is strengthened with 240 mm × 10 mm rectangular plate on top flange. If permissible stress in the material is 150 N/mm^2, determine how much concentrated load the beam of this section can carry at centre of 4 m span.

b1=float(240)
b=float(180)
t=float(10)
h=float(400)
w=float(8)

A=float(240*10+180*8+384*8+180*8)       #Area of section,A

Y=(240*10*405+180*8*(400-4)+384*8*200+180*8*4)/A

I=(b1*pow(t,3)/12)+(b1*t*(pow(((h+5)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow(((h-4)-Y),2)))+(w*pow((h-16),3)/12)+((h-16)*w*(pow(((h/2)-Y),2)))+(b*pow(w,3)/12)+(b*w*(pow((4-Y),2)))

ytop=(h+t/2)-Y
ybottom=Y
ymax=Y

Z=I/ymax
fper=150
M=fper*Z/1000000         #Momnent carrying capacity of the section

#Let P kN be the central concentrated load the simply supported beam can carry. Then max bending movement in the beam

P=M*4/(w/2)

print "P=",round(P,3),"KN"

P= 127.632 KN


# example10.6 page number 327¶

In :
#The cross-section of a cast iron beam. The top flange is in compression and bottom flange is in tension. Permissible stress in tension is 30 N/mm^2 and its value in compression is 90 N/mm^2
#variable declaration
from math import sqrt
b1=float(75)
h1=50
h2=50
b2=float(150)
t=float(25)
h=float(200)

A=float(75*50+25*100+150*50)       #Area of section,A

Y=(75*50*175+25*100*100+150*50*25)/A

I=(b1*pow(h1,3)/12)+(b1*h1*(pow(((h-(h1/2))-Y),2)))+(t*pow((h-h1-h2),3)/12)+(t*(h-h1-h2)*(pow(((h/2)-Y),2)))+(b2*pow(h2,3)/12)+(b2*h2*(pow(((h2/2)-Y),2)))

ytop=(h-Y)
ybottom=Y

Z1=I/ytop
fperc=90
#Top fibres are in compression. Hence from consideration of compression strength, moment carrying capacity of the beam is given by

M1=fperc*Z1/1000000         #Momnent carrying capacity of the section,KN-m.

#Bottom fibres are in tension. Hence from consideration of tension, moment carrying capacity of the section is given by

Z2=I/ybottom

fpert=30

M2=fpert*Z2/1000000        #Momnent carrying capacity of the section,KN-m.

#Actual moment carrying capacity is the lower value of the above two values. Hence moment carrying capacity of the section is
Mmax=min(M1,M2)

L=float(5)
w=sqrt(Mmax*8/pow(L,2))

print"w=",round(w,3),"KN/m"
print"calculation mistake in book"

w= 2.734 KN/m
calculation mistake in book


# example10.7 page number 327¶

In :
#The diameter of a concrete flag post varies from 240 mm at base to 120 mm at top. The height of the post is 10 m. If the post is subjected to a horizontal force of 600 N at top
#Consider a section y metres from top. Diameter at this section is d.
#d=120+12*y
#I=pi*pow(d,4)/64
#Z=I*2/d=pi*pow(d,3)/32
#variable declaration
#M=600*1000*y #moment,N-mm
#f*Z=M,f is extreme fibre stress.
from math import pi
y=float(5)
print "y=",round(y,2),"m"

#Stress at this section f is given by
P=600
M=P*y*1000
d=120+12*y
I=pi*pow(d,4)/64
Z=I*2/d

f=M/Z

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

y= 5.0 m
f= 5.24 N/mm^2


# example 10.9 page number 329¶

In :
#Design a timber beam is to carry a load of 5 kN/m over a simply supported span of 6 m. Permissible stress in timber is 10 N/mm2. Keep depth twice the width.

#variable declaration
w=float(5)                  #KN/m
L=float(6)                  #m

M=w*1000000*pow(L,2)/8              #Maximum bending moment,N-mm

#Let b be the width and d the depth. Then in this problem d = 2b.
#Z=b*pow(d,2)/6=2*(b**3)/3
f=10                       #N/mm^2
#f*Z=M
b=float(((M*3)/(2*f))**(0.3333))
print "b=",round(b),"mm"

d=2*b
print "d=",round(d),"mm"

b= 150.0 mm
d= 300.0 mm


# example 10.10 page number 329¶

In :
from math import sqrt
#A cantilever of 3 m span, carrying uniformly distributed load of 3 kN/m is to be designed using cast iron rectangular section. Permissible stresses in cast iron are f = 30 N/mm^2 in tension and fc = 90 N/mm^2 in compression

L=float(3)                    #Span of cantilever,m
w=float(3)                    #uniformly distributed load,KN/m

M=w*1000000*pow(L,2)/2        #Maximum moment,N-mm
#let b be the width and d the depth
#Z=b*pow(d,2)/6

#Since it is rectangular section, N-A lies at mid-depth, and stresses at top and bottom are same. Hence, permissible tensile stress value is reached earlier and it governs the design.
fper=30                       #N/mm^2
b=100                         #mm
f=30

#f*Z=M

d=sqrt((M*6)/(b*f))

print "d=",round(d,1),"mm"

d= 164.3 mm


# example 10.11 page number 330¶

In :
from math import pi

#variable declaration

# Let the diameter of the bar be ‘d’. Now, W = 800 N L = 1 m = 1000 mm
L=1000
W=800
M=W*L/4                     #Maximum moment,N-mm
f=150                       #permissible stress,N/mm^2

d=float((((M*32)/(pi*f)))**(0.33))

print "d=",round(d,2),"mm"
print "select 25mm bar "

d= 23.11 mm
select 25mm bar