Chapter 20:Beams (Shear Force And Bending Moment)

Example 20.1,Page No.730

In [1]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths

L=2 #m #Span of beam
L_AB=0.5 #m
L_BC=0.7 #m
L_CD=0.8 #m

#Point Load
F_D=800 #N
F_C=500 #N
F_B=300 #n

#Calculations

#Let R_A  be the reactions at A 
R_A=F_B+F_C+F_D #N

#Shear Force Calculations

#Shear Force at pt D
V_D=F_D #N

#Shear Force at pt C
V_C1=V_D #N
V_C2=V_D+F_C #N

#Shear force at pt B
V_B1=V_C2 #N
V_B2=V_C2+F_B

#Shear Force at pt A
V_A=V_B2 #N

#Bending Moment Calculations

#B.M at D
M_D=F_D*0 #N.m

#B.M at pt C
M_C=F_D*L_CD #N.m

#B.M at pt B
M_B=F_D*(L_CD+L_BC)+F_C*L_BC #N.m

#B.M at pt A
M_A=F_D*L+F_C*(L_BC+L_AB)+F_B*L_AB #N.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_CD,L_CD,L_CD+L_BC,L_CD+L_BC,L_CD+L_BC+L_AB]
Y1=[V_D,V_C1,V_C2,V_B1,V_B2,V_A]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_D,M_C,M_B,M_A]
X2=[0,L_CD,L_CD+L_BC,L_CD+L_BC+L_AB]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.2,Page No.733

In [2]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#lengths
L_CB=1.5 #m 
L_AC=0.5 #m

#Loads
w=1 #KN/m #u.d.l

#Calculations

R_A=w*L_CB #KN

#Shear Force Calculations

#S.F at B
V_B=0

#S.F at C
V_C=w*L_CB #KN

#S.F at  A
V_A=V_C #KN

#Bending Moment Calculations

#B.M at B
M_B=0

#B.M at C
M_C=w*L_CB*L_CB*2**-1

#B.M at A
M_A=w*L_CB*(L_CB*2**-1+L_AC) #KN

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_CB,L_CB+L_AC]
Y1=[V_B,V_C,V_A]
Z1=[0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_C,M_A]
X2=[0,L_CB,L_AC+L_CB]
Z2=[0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.3,Page No.734

In [3]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_AB=2 #m

#Load
w=2 #KN/m 
F_B=3 #KN

#Calculations

#LEt R_A be the reaction at pt A
R_A=F_B+w*L_AB

#Shear Force Calculations

#S.F at B
V_B=F_B #KN

#S.F at A
V_A=V_B+w*L_AB #KN

#Bending Moment Calculations

#B.M at B
M_B=0 #KN.m

#B.M at A
M_A=F_B*L_AB+w*L_AB*L_AB*2**-1 #KN.m


#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_AB]
Y1=[V_B,V_A]
Z1=[0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_A]
X2=[0,L_AB]
Z2=[0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.4,Page No.736

In [4]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_CB=0.5 #m
L_AC=1.5 #m
L=2 #m 

#Loads
F_C=2 #KN
w=1.5 #KN/m

#Calculations

#Let R_A be the reaction at pt A
R_A=F_C+w*L #KN

#Shear Force Calculations

#S.F at pt B
V_B=0 #KN

#S.F At pt C
V_C1=w*L_CB #KN
V_C2=V_C1+F_C #KN

#S.F at pt A
V_A=F_C+w*L #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt C
M_C=w*L_CB*L_CB*2**-1

#B.M at pt A
M_A=F_C*L_AC+w*L*L*2**-1 #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_CB,L_CB,L_AC+L_AC]
Y1=[V_B,V_C1,V_C2,V_A]
Z1=[0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_C,M_A]
X2=[0,L_CB,L_AC+L_CB]
Z2=[0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.5,Page No.738

In [5]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_CB=0.25 #m
L_DC=1 #m 
L_AD=0.25 #m
L_DB=1.25 #m
L=1.5 #m

#Loads
F_C=3 #KN #Point Load
w=2 #KN/m #u.d.l

#Calculations

#Let R_A be the reaction at A
R_A=F_C+w*(L_DC+L_CB)

#Shear Force calculations

#S.F at pt B
V_B=0

#S.F at pt C
V_C1=w*L_CB #KN
V_C2=V_C1+F_C #KN

#S.F at D
V_D=w*(L_DC+L_CB)+F_C #KN

#S.F at pt A
V_A=V_D #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0

#B.M at pt C
M_C=w*L_CB*L_CB*2**-1 #KN.m

#B.M at pt D
M_D=w*L_DB*L_DB*2**-1+F_C*L_DC #KN.m

#B.M at pt A
M_A=w*L_DB*(L_DB*2**-1+L_AD)+F_C*(L_DC+L_AD) #KN.m


#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_CB,L_CB,L_CB+L_DB,L_CB+L_DB+L_AD]
Y1=[V_B,V_C1,V_C2,V_D,V_A]
Z1=[0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_C,M_D,M_A]
X2=[0,L_CB,L_DC+L_CB,L_DC+L_CB+L_AD]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.6,Page No.739

In [6]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_CB=0.5 #m
L_DC=2 #m
L_ED=1.5 #m
L_AE=1 #m
L=5 #m

#Forces
F_B=2.5 #KN
F_E=3 #KN
w=1 #KN/m #u.d.l

#Calculations

#Let R_A  be the reaction at A
R_A=F_B+F_E+w*L_DC #KN

#Shear Force calculations

#S.F at pt B
V_B=F_B

#S.F at pt C
V_C=V_B #KN

#S.F at pt D
V_D=V_C+w*L_DC #KN

#S.F at pt E
V_E1=V_D #KN
V_E2=V_D+F_E #KN

#S.F at pt A
V_A=V_E2 #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt C
M_C=F_B*L_CB #KN.m

#B.M at pt D
M_D=w*L_DC*L_DC*2**-1+F_B*(L_CB+L_DC) #KN.m

#B.M at pt E
M_E=F_B*(L_ED+L_DC+L_CB)+w*L_DC*(L_DC*2**-1+L_ED) #KN.m

#B.M at pt A
M_A=F_B*L+w*L_DC*(L_DC*2**-1+L_ED+L_AE)+F_E*L_AE #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_CB,L_CB+L_DC,L_CB+L_DC+L_ED,L_CB+L_DC+L_ED,L_CB+L_DC+L_ED+L_AE]
Y1=[V_B,V_C,V_D,V_E1,V_E2,V_A]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_C,M_D,M_E,M_A]
X2=[0,L_CB,L_DC+L_CB,L_ED+L_DC+L_CB,L_ED+L_DC+L_CB+L_AE]
Z2=[0,0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.7,Page No.741

In [7]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

L_AB=4 #m #Length of AC
w=2 #KN/m #u.v.l

#Calculations

#Shear force calculation

#S.F at pt B
V_B=0 #KN

#S.F at pt A
V_A=w*L_AB*2**-1 #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt A
M_A=w*L_AB**2*6**-1 #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_AB]
Y1=[V_B,V_A]
Z1=[0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_A]
X2=[0,L_AB]
Z2=[0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.8,Page No.745

In [8]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_DB=L_CD=L_AC=2 #m
L=6 #m

#Loads
F_C=3 #KN
F_D=6 #KN


#Calculations

#Let R_A & R_B be the reactions at pt A & B respectively
#R_A+R_B=F_C+F_D

#Taking Moment at pt A,M_A
R_B=(F_D*(L_AC+L_CD)+F_C*L_AC)*L**-1 #KN
R_A=(F_C+F_D)-R_B

#Shear force calculations

#S.F at pt B
V_B=R_B #KN

#S.F at pt D
V_D1=R_B #KN
V_D2=V_D1-F_D #KN

#S.F at C
V_C1=V_D2 #KN
V_C2=V_D2-F_C #KN

#S.F at pt A
V_A1=V_C2 #KN
V_A2=V_C2+R_A #KN

#Bending Moment calculations

#B.M at pt B
M_B=0 #KNm

#B.M at pt D
M_D=-R_B*L_DB #KN.m

#B.M at pt C
M_C=F_D*L_CD-R_B*(L_DB+L_CD) #KN.m

#B.M at pt A
M_A=-R_B*L+F_D*(L_CD+L_AC)+F_C*L_AC #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_DB,L_DB,L_DB+L_CD,L_DB+L_CD,L_DB+L_CD+L_AC,L_DB+L_CD+L_AC]
Y1=[V_B,V_D1,V_D2,V_C1,V_C2,V_A1,V_A2]
Z1=[0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_D,M_C,M_A]
X2=[0,L_DB,L_CD+L_DB,L_AC+L_CD+L_DB]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.9,Page No.748

In [9]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#LEngths
L_CB=3 #m
L_AC=6 #m
L= 9 #m

#Loads
w=10 #KN/m 

#Calculations

#Let R_A & R_B be the reactions at pt A & B respectively
#R_A+R_B=w*L_AC

#Taking Moment at pt A,M_A
R_B=w*L_AC*L_AC*2**-1*L**-1 #KN.m
R_A=w*L_AC-R_B #KN.m

#Shear force calculations

#S.F at pt B
V_B1=0
V_B2=R_B #KN

#S.F at pt C
V_C=V_B2 #KN

#S.F at pt A
V_A1=V_C-w*L_AC #KN
V_A2=V_C-w*L_AC+R_A #KN

#Bending Moment calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt C
M_C=-R_B*L_CB #KN.m

#B.M at pt A
M_A=-R_B*L+w*L_AC*L_AC*2**-1 #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_CB,L_CB+L_AC,L_CB+L_AC]
Y1=[V_B1,V_B2,V_C,V_A1,V_A2]
Z1=[0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_C,M_A]
X2=[0,L_CB,L_CB+L_AC]
Z2=[0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.10,Page No.749

In [10]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_DB=3 #m
L_CD=4 #m
L_AC=1 #m
L=8 #m

#Loads
w=10 #KN/m

#Calculations

#Let R_A & R_B be the reactions at A & B respectively
#R_A+R_B=w*L_CD

#Taking moment at pt A,M_A
R_B=(w*L_CD*(L_CD*2**-1+L_AC))*L**-1 #KN
R_A=w*L_CD-R_B #KN

#Shear Force calculations

#S.F at pt B
V_B1=0
V_B2=R_B #KN

#S.F at pt D
V_D=V_B2 #KN

#S.F at pt C
V_C=-w*L_CD+R_B #KN

#S.F at pt A
V_A1=V_C #KN
V_A2=V_C+R_A


#Bending Moment calculations

#B.A at pt B
M_B=0

#B.M at pt D
M_D=-R_B*L_DB #KN.m

#B.M at pt C
M_C=-R_B*(L_DB+L_CD)+w*L_CD*L_CD*2**-1 #KN.m

#B.M at pt A
M_A=-R_B*L+w*L_CD*(L_CD*2**-1+L_AC) #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_DB,L_DB+L_CD,L_AC+L_DB+L_CD,L_AC+L_DB+L_CD]
Y1=[V_B1,V_B2,V_D,V_C,V_A1,V_A2]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_D,M_C,M_A]
X2=[0,L_DB,L_DB+L_CD,L_AC+L_CD+L_DB]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.11,Page No.751

In [11]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_DB=2 #m 
L_CD=2 #m
L_AC=3 #m
L=7 #m

#Loads
w1=5 #KN/m
w2=10 #KN/m

#Calculations

#Let R_A & R_B be the reactions at A & B respectively
#R_A+R_B=w*L_AC+w*L_DB

#Taking moment at pt A,M_A
R_B=(w1*L_DB*(L_DB*2**-1+L_CD+L_AC)+w2*L_AC*L_AC*2**-1)*L**-1 #KN
R_A=(w1*L_DB+w2*L_AC)-R_B

#Shear Force Calculations

#S.F at pt B
V_B1=0 #KN
V_B2=R_B #KN

#S.F at pt D
V_D=R_B-w1*L_DB #KN

#S.F at pt C
V_C=V_D #KN

#S.F at pt A
V_A1=V_C-w2*L_AC #KN
V_A2=V_A1+R_A #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt D
M_D=w1*L_DB*L_DB*2**-1-R_B*L_DB #KN.m

#B.M at pt C
M_C=-R_B*(L_CD+L_DB)+w1*L_DB*(L_DB*2**-1+L_CD) #KN.m

#B.M at pt A
M_A=-R_B*L+w1*L_DB*(L_DB*2**-1+L_CD+L_AC)+w2*L_AC*L_AC*2**-1 #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_DB,L_DB+L_CD,L_AC+L_CD+L_DB,L_AC+L_CD+L_DB]
Y1=[V_B1,V_B2,V_D,V_C,V_A1,V_A2]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_D,M_C,M_A]
X2=[0,L_DB,L_CD+L_DB,L_AC+L_CD+L_DB]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.12,Page No.752

In [12]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_DB=4 #m
L_CD=4 #m
L_AC=2 #m
L=10 #m

#Loads
F_D=40 #KN
F_C=50 #KN
w=10 #KN/m

#Calculations


#Let R_A & R_B be the reactions at A & B respectively
#R_A+R_B=w*L_CD+F_C+F_D

#Taking moment at pt A,M_A
R_B=(F_C*L_AC+w*L_CD*(L_CD*2**-1+L_AC)+F_D*(L_CD+L_AC))*L**-1 #KN
R_A=(w*L_CD+F_C+F_D)-R_B #KN

#Shear Force calculations

#S.F at pt B
V_B1=0 #KN
V_B2=R_B #KN

#S.F at pt D
V_D1=V_B2 #KN
V_D2=V_B2-F_D #KN

#S.F at pt C
V_C1=V_D2-w*L_CD #KN
V_C2=V_C1-F_C #KN

#S.F at pt A
V_A1=V_C2 #KN
V_A2=V_C2+R_A #KN

#Bending Moment calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt D
M_D=-R_B*L_DB #KN.m

#B.M at pt C
M_C=-R_B*(L_DB+L_CD)+F_D*L_CD+w*L_CD*L_CD*2**-1 #KN.m

#B.M at pt A
M_A=-R_B*L+F_D*(L_CD+L_AC)+F_C*L_AC+w*L_CD*(L_CD*2**-1+L_AC)

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_DB,L_DB,L_DB+L_CD,L_DB+L_CD,L_DB+L_CD+L_AC,L_DB+L_CD+L_AC]
Y1=[V_B1,V_B2,V_D1,V_D2,V_C1,V_C2,V_A1,V_A2]
Z1=[0,0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_D,M_C,M_A]
X2=[0,L_DB,L_DB+L_CD,L_AC+L_CD+L_DB]
Z2=[0,0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.13,Page No.758

In [13]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

L_AB=5 #m #Length of AB
F_1=800 #N u.d.l
F_2=1600 #N u.v.l

#Calculations

#Load on beam due to u.d.l of 800 N/m
w1=F_1*L_AB #N

#Load on beam due to triangular Loading
w2=F_1*L_AB*2**-1 #N

#Calculation of reactions R_A & R_B
#Taking moment about A,we get
#R_B=w1*L_AB*2**-1+w2**(2*5**-1of5)
#After further simplifying we get
R_B=2000+1333.33 #N
R_A=(w1+w2)-R_B #N

#Consider any section X-X at a distance x from A.
#Rate of Loading at the section X-X
#w_x=800+160*x

#Total Load on length AX
#W=800*x+80*x**2

#Now the S.F at the section X-X is given by,
#F_x=R_A-Load on length AX
#After sub values and further simplifying we get
#F_x=2666.67-800*x-80*x**2    ............................(1)

#Equation 1 shows that shear force between A & B 
#At A
x=0
F_x1=F_x=2666.67-800*x-80*x**2 #N

#At B
x=5
F_x2=F_x=2666.67-800*x-80*x**2 #N

#Finding the position of zero shear.Equating S.F equal to zero in eqn(1)
#0=2666.67-800*x-80*x**2
#Further simplifying we get
#x**2+10*x-33.33=0
a=1
b=10
c=-33.33

X=b**2-4*a*c

x1=(-b+X**0.5)*(2*a)**-1 #m
x2=(-b-X**0.5)*(2*a)**-1 #m

#B.M Diagram
#B.M at the section X-X is given by
#M_x=R_A*x-800*x**2*2**-1-x**3*80*3**-1
#Further simplifyng we get
#M_x=2666.67*x-400*x**2-80*3**-1*x**3    ............2

#Equation 2 shows that B.M between A & B varies 
#At A
x=0
M_x1=2666.67*x-400*x**2-80*3**-1*x**3 #KN/m

#At B
x=5
M_x2=2666.67*x-400*x**2-80*3**-1*x**3 #KN/m

#value of M_X2 is very small .i.e equal to zero
#MAx B.M occurs where S.F is zero.
#But shear force is zero at distance of 2.637m from A.
#hence max B.M is Obtained by sub 
x=2.637 #m
M_x=2666.67*x-400*x**2-80*3**-1*x**3

#Plotting the Shear Force Diagram

X1=[0,L_AB]
Y1=[F_x1,F_x2]
Z1=[0,0,]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_x1,M_x2]
X2=[0,L_AB]
Z2=[0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()

Example 20.14,Page No.760

In [14]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

L_AB=4 #m
L_BC=2 #m
L=6 #m
w=2 #KN/m #u.d.l

#Calculations

#Let R_A and R_B be the reactions at A & B respectively
#R_A+R_B=w*L
 
#Taking Moment at A,M_A
R_B=(w*L*L*2**-1)*L_AB**-1 #KN
R_A=w*L-R_B #KN

#Shear Force calculations 

#S.f at pt C
V_C=0

#S.F at pt B
V_B1=-w*L_BC #KN
V_B2=V_B1+R_B #KN

#S.F at pt A
V_A1=V_B2-w*L_AB #KN
V_A2=V_A1+R_A #KN

#Bending Moment Calculations

#B.M at pt C
M_C=0 #KN.m

#B.M at pt B
M_B=w*L_BC #KN.m

#B.M at pt A
M_A=w*L*L*2**-1-R_B*L_AB #KN.m


#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,L_BC,L_BC,L_BC+L_AB,L_BC+L_AB]
Y1=[V_C,V_B1,V_B2,V_A1,V_A2]
Z1=[0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_C,M_B,M_A]
X2=[0,L_BC,L_BC+L_AB]
Z2=[0,0,0]
plt.plot(X2,Y2)
plt.xlabel("Lenght in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.15,Page No.762

In [15]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_AB=4 #m
L_BC=2 #m
L=6 #m

#Loads
w=2 #KN/m
F_C=2 #KN

#Calculations

#Let R_A and R_B be the reactions at A & B respectively
#R_A+R_B=w*L+F_C
 
#Taking Moment at A,M_A
R_B=(F_C*L+w*L*L*2**-1)*L_AB**-1 #KN
R_A=(w*L+F_C)-R_B #KN

#Shear Force calculations

#S.F at pt C
V_C1=0 #KN
V_C2=F_C #KN

#S.F at pt B
V_B1=-w*L_BC-F_C #KN
V_B2=V_B1+R_B #KN

#S.F at pt A
V_A1=V_B2-w*L_AB #KN
V_A2=V_A1+R_A #KN

#Bending Moment Calculations

#B.M at pt C
M_C=0 #KN.m

#B.M at pt B
M_B=w*L_BC*L_BC*2**-1+F_C*L_BC #KN.m

#B.M at pt A
M_A=F_C*L+w*L*L*2**-1-R_B*L_AB #KN.m

#Result
print"The Shear Force and Bending Moment are the Results"

#Plotting Shear Force Diagram

X1=[0,0,L_BC,L_BC,L_BC+L_AB,L_AB+L_BC]
Y1=[V_C1,V_C2,V_B1,V_B2,V_A1,V_A2]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length in m")
plt.ylabel("Shear Force in KN")
plt.show()

#plotting the Bending Moment Diagram

X2=[0,L_BC,L_BC+L_AB]
Y2=[M_C,M_B,M_A]
Z2=[0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in KN.m")
plt.show()
The Shear Force and Bending Moment are the Results

Example 20.16,Page No.763

In [16]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_BD=L_CA=2 #m
L_AB=8 #m
L=12 #m

#Loads
F_D=F_C=1000 #N

#Calculations

#Let R_A & R_b be the reactions at A & B respectively
#As the Load on the beam is symmetrical,R_A and R_B will be equal
#Their magnitude will be half of the total Load

R_A=R_B=(F_C+F_D)*2**-1 #N

#Shear force calculations

#S.F at pt D
V_D1=0 #N
V_D2=-F_D #N

#s.F at pt B
V_B1=V_D2 #N
V_B2=V_B1+R_B #N

#S.F at pt A
V_A1=V_B2 #N
V_A2=V_A1+R_A #N

#S.F at pt C
V_C1=V_A2 #N
V_C2=V_C1-F_C

#Bending Moment Calculations

#B.M at pt D
M_D=0 #KN.m

#B.M at pt B
M_B=F_D*L_BD #KN.m

#B.M at pt A
M_A=F_D*(L_BD+L_AB)-R_B*L_AB #KN.m

#B.M at pt C
M_C=F_D*L-R_B*(L_AB+L_CA)-R_A*L_CA #KN.m


#Result
print"The Shear Force And Bending Moment diagrams are the Results"

#plotting Shear Force Diagram

X1=[0,0,L_BD,L_BD,L_BD+L_AB,L_BD+L_AB,L_CA+L_BD+L_AB,L_CA+L_BD+L_AB]
Y1=[V_D1,V_D2,V_B1,V_B2,V_A1,V_A2,V_C1,V_C2]
Z1=[0,0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length in m")
plt.ylabel("Shear force in N")
plt.show()

#Plotting Bending Moment diagram

X2=[0,L_BD,L_BD+L_AB,L_CA+L_AB+L_BD]
Y2=[M_D,M_B,M_A,M_C]
Z2=[0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in N.m")
plt.show()
The Shear Force And Bending Moment diagrams are the Results

Example 20.17,Page No.765

In [17]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_BE=2 #m
L_DB=L_CA=3 #m
L_AD=5 #m
L_AB=8 #m
L=13 #m

#Loads
F_E=1000 #N
F_C=800  #N
F_D=2000 #N

#Calculations

#Let R_A and R_B be the reactions at pt A and B respectively
#Taking Moment at pt A
R_B=(-F_C*L_CA+F_D*L_AD+F_E*(L_AD+L_DB+L_BE))*L_AB**-1 #KN
R_A=(F_C+F_D+F_E)-R_B   #KN

#Shear Force Calculations

#S.F at pt E
V_E1=0 #KN
V_E2=-F_E #KN

#S.F at pt B
V_B1=V_E2 #KN
V_B2=V_B1+R_B #KN

#S.F at pt D
V_D1=V_B2 #KN
V_D2=V_D1-F_D #KN

#S.F at pt A
V_A1=V_D2 #KN
V_A2=V_A1+R_A #KN

#S.F at pt C
V_C1=V_A2 #KN
V_C2=V_C1-F_C #KN
 
#Bending Moment Calculations

#B.M at pt E
M_E=0 #KN.m 

#B.M at pt B
M_B=F_E*L_BE #KN,m

#B.M at pt D
M_D=F_E*(L_BE+L_DB)-R_B*L_DB #KN.m

#B.M at pt A
M_A=F_D*L_AD+F_E*(L_AD+L_DB+L_BE)-R_B*(L_DB+L_AD) #KN.m

#B.M at pt C
M_C=F_E*L+F_D*(L_AD+L_CA)-R_A*L_CA-R_B*(L_CA+L_AD+L_DB) #KN.m

#Result
print"The Shear Force and Bending Moment diagrams are the results"

#Plotting Shear force Diagrams

X1=[0,0,L_BE,L_BE,L_BE+L_DB,L_BE+L_DB,L_AD+L_BE+L_DB,L_AD+L_BE+L_DB,L_AD+L_BE+L_DB+L_CA,L_AD+L_BE+L_DB+L_CA]
Y1=[V_E1,V_E2,V_B1,V_B2,V_D1,V_D2,V_A1,V_A2,V_C1,V_C2]
Z1=[0,0,0,0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length in m")
plt.ylabel("Shear Force in KN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_E,M_B,M_D,M_A,M_C]
X2=[0,L_BE,L_BE+L_DB,L_BE+L_DB+L_AD,L_BE+L_DB+L_AD+L_CA]
Z2=[0,0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment diagrams are the results

Example 20.18,Page No.766

In [18]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables 
L=10 #m #span
w=1 #KN/m #u.d.l
l=6 #m #Span betwen A & B
l_AC=2.23 #m #Length AC
l_BD=1.77 #m #LEngth BD

#Calculations

#Let R_A  & R_B be the reactions at A & B respectively
#Taking moment at A
#x**2*x*2**-1+R_B*l=(10-x)**2*2**-1
#After simplifying we get,
#R_A=5*3**-1*(5-x)
#R_B=5*3**-1*(1+x)

#Let y be the distance at which B.M is maximum at section ABfrom  C
#S.F at section AB 
#R_A=y
#Substituting value of R_A from above equation
#y=5*3**-1*(1+x)...................................1

#B.M at A
#M_A=x**2*2**-1 

#B.M at distance y from C
#M_C=y**2*2**-1+R_A*(y-x)....................2
#After further simplifying we get
#M_C=5*18**-1*(-x**2+4*x+5).............................3

#EQuating equations 1 & 2,we get quadratic equation as
#14x**2-20x-25=0
a=14
b=-20
c=-25

X=b**2-4*a*c
x=(-b+X**0.5)*(2*a)**-1

#Substituing value of x in equation 1 we get
y=5*3**-1*(1+x)

#Sub values of x & y we get values of R_A & R_B as follows
R_B=5*3**-1*(5-x)
R_A=5*3**-1*(1+x)

#Shear Force calculations

#S.F at pt C
V_C=0

#S.F at A
V_A1=-w*l_AC #KN
V_A2=V_A1+R_A #KN

#S.F at pt B
V_B1=V_A2-1*l #KN
V_B2=V_B1+R_B #KN

#S.F at D
V_D=V_B2-l_BD

#BEnding Moment calculations

#B.M at C
M_C=0

#B.M at A
M_A=-w*l_AC**2*2**-1 #KNm

#B.M at E i.e at y=5.38 m
M_E=-w*y**2*2**-1+R_A*(y-l_AC)

#B.M at B
M_B=-w*(l_AC+l)**2*2**-1+R_A*l

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,l_AC,l_AC,l_AC+l,l_AC+l,l_AC+l+l_BD]
Y1=[V_C,V_A1,V_A2,V_B1,V_B2,V_D]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_C,M_A,M_E,M_B]
X2=[0,l_AC,l_AC+y,l_AC+l]
Z2=[0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.19,Page No.770

In [23]:
import math
import matplotlib.pyplot as plt
from math import sin, cos, radians, pi

#Declaration Of Variables

#Lengths
L_EB=L_DE=L_CD=L_AC=1 #m
L=4 #m

#Loads
#point Load

#At pt D
F_D1=200*sin(45*pi*180**-1)
F_D2=200*cos(45*pi*180**-1)

#At pt C
F_C1=100*sin(60*pi*180**-1)
F_C2=100*cos(60*pi*180**-1)

#At pt E
F_E1=300*sin(30*pi*180**-1)
F_E2=300*cos(30*pi*180**-1)

#Calculations

#Let R_A and R_B be the reactions at pt A and B respectively
#R_A+R_B=F_D1+F_C1+F_E1 #KN

#Taking Moment at pt A
R_B=(F_E1*(L_AC+L_CD+L_DE)+F_D1*(L_AC+L_CD)+F_C1*L_AC)*L**-1 #KN
R_A=(F_D1+F_C1+F_E1)-R_B #KN

#Shear Force Calculations

#S.F at pt B
V_B1=0 #N
V_B2=R_B #N

#S.F at pt E
V_E1=V_B2 #N
V_E2=V_E1-F_E1 #N

#S.F at pt D
V_D1=V_E2 #N
V_D2=V_D1-F_D1 #N

#S.F at pt C
V_C1=V_D2 #N
V_C2=V_C1-F_C1 #N

#S.F at pt A
V_A1=V_C2 #N
V_A2=V_A1+R_A

#Bending Moment Diagrams

#B.M At pt B
M_B=0 #KN.m

#B.M at pt E
M_E=-R_B*L_EB #KN.m

#B.M at pt D
M_D=-R_B*(L_DE+L_EB)+F_E1*L_DE #KN.m

#B.M at pt C
M_C=-R_B*(L_CD+L_DE+L_EB)+F_E1*(L_CD+L_DE)+F_D1*L_CD #KN.m

#B.M at pt A
M_A=-R_B*L+F_E1*(L_CD+L_DE+L_AC)+F_D1*(L_AC+L_CD)+F_C1*L_AC #KN.m

#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_EB,L_EB,L_EB+L_DE,L_EB+L_DE,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD]
Y1=[V_B1,V_B2,V_E1,V_E2,V_D1,V_D2,V_C1,V_C2,V_A1,V_A2]
Z1=[0,0,0,0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_E,M_D,M_C,M_A]
X2=[0,L_EB,L_DE+L_EB,L_DE+L_EB+L_CD,L_DE+L_EB+L_CD+L_AC]
Z2=[0,0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.20,Page No.772

In [20]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_AC=L_CD=L_DE=L_EB=2 #m
L=8 #m

#Loads
#point Load

#At pt E
F_E1=6*sin(pi*180**-1*45) #KN
F_E2=6*cos(pi*180**-1*45) #KN

#At pt D
F_D1=8*sin(pi*180**-1*60) #KN
F_D2=8*cos(pi*180**-1*60) #KN

#At pt C
F_C1=4*sin(pi*180**-1*30) #KN
F_C2=4*cos(pi*180**-1*30) #KN

#Calculations

#Let R_A and R_B be the reactions at pt A and B respectively
#R_A+R_B=F_D1+F_C1+F_E1 #KN

#Taking Moment at pt A
R_B=(F_E1*(L_AC+L_CD+L_DE)+F_D1*(L_AC+L_CD)+F_C1*L_AC)*L**-1 #KN
R_A=(F_D1+F_C1+F_E1)-R_B #KN

#Shear Force Calculations

#S.F at pt B
V_B1=0 #N
V_B2=R_B #N

#S.F at pt E
V_E1=V_B2 #N
V_E2=V_E1-F_E1 #N

#S.F at pt D
V_D1=V_E2 #N
V_D2=V_D1-F_D1 #N

#S.F at pt C
V_C1=V_D2 #N
V_C2=V_C1-F_C1 #N

#S.F at pt A
V_A1=V_C2 #N
V_A2=V_A1+R_A

#Bending Moment Diagrams

#B.M At pt B
M_B=0 #KN.m

#B.M at pt E
M_E=-R_B*L_EB #KN.m

#B.M at pt D
M_D=-R_B*(L_DE+L_EB)+F_E1*L_DE #KN.m

#B.M at pt C
M_C=-R_B*(L_CD+L_DE+L_EB)+F_E1*(L_CD+L_DE)+F_D1*L_CD #KN.m

#B.M at pt A
M_A=-R_B*L+F_E1*(L_CD+L_DE+L_AC)+F_D1*(L_AC+L_CD)+F_C1*L_AC #KN.m


#Result
print "The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_EB,L_EB,L_EB+L_DE,L_EB+L_DE,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD,L_EB+L_DE+L_CD]
Y1=[V_B1,V_B2,V_E1,V_E2,V_D1,V_D2,V_C1,V_C2,V_A1,V_A2]
Z1=[0,0,0,0,0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_E,M_D,M_C,M_A]
X2=[0,L_EB,L_DE+L_EB,L_DE+L_EB+L_CD,L_DE+L_EB+L_CD+L_AC]
Z2=[0,0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results

Example 20.21,Page No.774

In [21]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_CB=4 #m
L_AC=2 #m
L=6 #m

#Loads
m=24 #KN.m #couple

#Calculations

#Let R_A and R_B be the reactions at pt A and B respectively
#R_A+R_B=0
#Taking Moment at pt A
R_B=m*L**-1 #KN
R_A=-R_B #KN

#Shear Force Calculations

#S.f at pt B
V_B1=0 #KN
V_B2=R_B #KN

#S.F at pt C
V_C=V_B2 #KN

#S.F at pt A
V_A1=V_C #KN
V_A2=V_A1+R_A #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt C
M_C1=-R_B*L_CB #KN.m
M_C2=M_C1+m #KN.m

#B.M at pt A
M_A=-R_B*L+m #KN.m

#Result
print"The Shear Force and Bending Moment are the results"

#Plotting Shear Force Diagram

X1=[0,0,L_CB,L_CB+L_AC,L_CB+L_AC]
Y1=[V_B1,V_B2,V_C,V_A1,V_A2]
Z1=[0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length in m")
plt.ylabel("Shear Force in KN")
plt.show()

#Plotting Bending Moment Diagram

X1=[0,L_CB,L_CB,L_CB+L_AC]
Y1=[M_B,M_C1,M_C2,M_A]
Z1=[0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in KN.m")
plt.show()
The Shear Force and Bending Moment are the results

Example 20.22,Page No.775

In [22]:
import math
import matplotlib.pyplot as plt

#Declaration Of Variables

#Lengths
L_DB=L_CD=2.5 #m
L_AC=5 #m
L=L=10 #m

#Loads
m=15000 #Nm #couple
w=1000 #N/m #u.d.l

#Calculations

#Let R_A and R_B be the reactions at pt A and B respectively
#R_A+R_B=w*L_AC
#Taking Moment at pt A
R_B=(w*L_AC*L_AC*2**-1-m)*L**-1 #KN
R_A=w*L_AC-R_B #KN

#Shear Force Calculations

#S.F  at pt B
V_B1=0 #KN
V_B2=R_B #KN

#S.F at pt D
V_D=V_B2 #KN

#S.F at pt C
V_C=V_D #KN

#S.F at pt A
V_A1=V_C-w*L_AC #KN
V_A2=V_A1+R_A #KN

#Bending Moment Calculations

#B.M at pt B
M_B=0 #KN.m

#B.M at pt D
M_D1=-R_B*L_DB #KN.m
M_D2=M_D1-m #KN.m

#B.M at pt C
M_C=-R_B*(L_CD+L_DB)-m #KN.m

#B.M at pt A
M_A=-R_B*L-m+w*L_AC*L_AC*2**-1 #KN.m

#Result
print"The Shear Force and Bending Moment Diagrams are the results"

#Plotting the Shear Force Diagram

X1=[0,0,L_DB,L_CD+L_DB,L_CD+L_DB+L_AC,L_CD+L_DB+L_AC]
Y1=[V_B1,V_B2,V_D,V_C,V_A1,V_A2]
Z1=[0,0,0,0,0,0]
plt.plot(X1,Y1,X1,Z1)
plt.xlabel("Length x in m")
plt.ylabel("Shear Force in kN")
plt.show()

#Plotting the Bendimg Moment Diagram

Y2=[M_B,M_D1,M_D2,M_C,M_A]
X2=[0,L_DB,L_DB,L_DB+L_CD,L_AC+L_CD+L_DB]
Z2=[0,0,0,0,0]
plt.plot(X2,Y2,X2,Z2)
plt.xlabel("Length in m")
plt.ylabel("Bending Moment in kN.m")
plt.show()
The Shear Force and Bending Moment Diagrams are the results