Chapter 8: Forces in Beams

Example 8.8-1, Page no 118

In [1]:
import math

#Initilization of variables
R_A=100 #N
R_B=200 #N

#Calculations
#Shear force at 2m
V=100 #N
#Moment at 2m
M=R_A*2 #N.m

#Result
print'The shear force at 2m is +',round(V),"N"
print'The moment at 2m is +',round(M),"N-m" 
The shear force at 2m is + 100.0 N
The moment at 2m is + 200.0 N-m

Example 8.8-2, Page no 118

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

#Initilization of variables
#length matrix
L1=[0,3.99,4,5.99,6] #m
#Bending moment matrix
B=[0,400,400,0.00001,0] #N.m
#Shear force plotting
#Here the left side and right side lengths are considered as close as 4 to keep up with right and left distinctions
L=[0,3.99,4,5.99,6]
S=[100,100,-200,-200,0]
g=[0,0,0,0,0]

#Calculations cum Result
d=transpose(L1)
e=transpose(S)
plt.plot(d,B)
xlabel('Span (m)')
ylabel('B.M (N.m)')
plt.show()
plt.plot(L,e,L,g)
xlabel('Span (m)')
ylabel('S.F (N)')
plt.show()

print'The graphs are the solutions'
The graphs are the solutions

Example 8.8-3, Page no 119

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

#Initilization of variables
w=196 #N/m
M_app=4000 #N.m
L=6 #m

#Calculations
#Taking Moment about Point L and equating it to 0
R_r=(M_app+w*L*L*0.5)/(3*L) #N
#Taking Moment about Point R and equating it to 0
R_l= ((((2*L)+(L/2))*(w*L))-(M_app))/(3*L) #N
#finding point of zero shear
a=R_l*w**-1
#defining x
x0=[0,18]
x=[0,0.5,1,1.5,2,2.5,3,3.5,a,4,4.5,5,5.5,6] #for 0<x<6
x1=[6,12] #for6<x<12
x2=[12,18] #for 12<x<18
xv=[6,12,18] #specially for shear force
xo=[12.001,12.002] #Straight line plot
#Shear Force Calculations
#Summing forces in vertical direction and equating to 0
V1=(R_l-w*x[0],R_l-w*x[1],R_l-w*x[2],R_l-w*x[3],R_l-w*x[4],R_l-w*x[5],R_l-w*x[6],R_l-w*x[7],R_l-w*x[8],R_l-w*x[9],R_l-w*x[10],R_l-w*x[11],R_l-w*x[12],R_l-w*x[13]) #N for 0<x<6
V2=(R_l)-(w*L) #N for 6<x<18
#Bending Moment Calculations
M1=(R_l*x[0]-w*x[0]**2*0.5,R_l*x[1]-w*x[1]**2*0.5,R_l*x[2]-w*x[2]**2*0.5,R_l*x[3]-w*x[3]**2*0.5,R_l*x[4]-w*x[4]**2*0.5,R_l*x[5]-w*x[5]**2*0.5,R_l*x[6]-w*x[6]**2*0.5,R_l*x[7]-w*x[7]**2*0.5,R_l*x[8]-w*x[8]**2*0.5,R_l*x[9]-w*x[9]**2*0.5,R_l*x[10]-w*x[10]**2*0.5,R_l*x[11]-w*x[11]**2*0.5,R_l*x[12]-w*x[12]**2*0.5,R_l*x[13]-w*x[13]**2*0.5) #N.m for 0<x<6
M2=(R_l*x1[0]-((w*L)*(x1[0]-3)),R_l*x1[1]-((w*L)*(x1[1]-3))) #N.m for 6<x<12
M3=(R_l*x2[0]-((w*L)*(x2[0]-3))+M_app,R_l*x2[1]-((w*L)*(x2[1]-3))+M_app) #N.m for 12<x<18
Mo=[-1464.8652,2509.3333]
#Maximum bending moment
M_max=R_l*a*0.5 #N.m

#Plotting SFD & BMD
p=[0,a,5.99,6,11.99,12,17.99,18]
y=[0,1467,1020,1020,-1486,2514,0,0]
z=[0,a,5.99,6,11.99,12,17.99,18]
b=[758,0,-418,-418,-418,-418,-418,0]
g=[0,0,0,0,0,0,0,0]
d=transpose(p)
e=transpose(b)
plt.plot(d,y,d,g)
xlabel('Span (m)')
ylabel('B.M (N.m)')
plt.show()
xlabel('Span (m)')
ylabel('S.F (N)')
plt.plot(z,e,z,g)
plt.show()

#Result
print'The value of reactions are: R_l=',round(R_l),"N",'and R_r=',round(R_r),"N"
print'The point of maximum bending moment is',round(a,2),"meters from left support",'and maximum bending moment is',round(M_max),"N.m"
print'The bending moment and shear force diagrams have been plotted'
The value of reactions are: R_l= 757.0 N and R_r= 418.0 N
The point of maximum bending moment is 3.86 meters from left support and maximum bending moment is 1462.0 N.m
The bending moment and shear force diagrams have been plotted

Example 8.8-4, Page no 121

In [3]:
import math
%matplotlib inline

#Initlization of  variables
F1=2000 #lb
w=100 #lb/ft

#Calculations
R_r=(-F1*5+w*14*13)/20 #lb
R_l=(F1*25+w*14*7)/20 #lb
#Shear Force matrix
V=[-2000,-2000,990,990,-410,0] #lb
#Bending Moment matrix
B=[0,-10000,-10000,-4060,840,0]
#Length matrix for shear force
X_v=[0,5,5.0001,11,20.89999,20.9]
#Length matrix for bendimg moment
X_b=[0,4.99,5,11,19.9,20.9]
g=[0,0,0,0,0,0]

#Plotting of SFD & BMD.
d=transpose(X_v)
e=transpose(V)
plt.plot(d,B,d,g)
xlabel('Span (ft)')
ylabel('B.M (lb.ft)')
plt.show()
plt.plot(X_b,e,X_b,g)
xlabel('Span (ft)')
ylabel('S.F (lb)')
plt.show()

#Result
print'The bending Moment and Shear Force diagrams have been plotted'
#Note
#The textbook does not specify the span and hence there seems to be a disagreement between the textbook and python solution.here the values have just been plotted
The bending Moment and Shear Force diagrams have been plotted