## Example 4.1 Page no 126¶

In [11]:
#Given
a_ab = 1		    #inch**2, area
a_bd = 2 		    #inch**2
a_bc = a_bd
l_ab = 2		   #ft
l_bc = 1.5 		   #ft
l_cd = 1 	     #ft

#Calculations
#Internal Forces By method of Sections
p_bc = 15         #kip
p_cd = 7          #kip
p_ab=9           #kip
#Displacement
d=(p_bc*l_ab*12/(a_ab*p*10**3))+(p_cd*l_bc*12/(a_bd*p*10**3))+(p_ab*l_cd*12/(a_bc*p*10**3))
d_=p_cd*l_bc*12/(a_bd*p*10**3)

#Display
print"The displacement of B relative to C is = +%1.3f mm",round(d*10,4),"inch"
print "Displacement of B relative to C is",round(d_,5),"inch"

The displacement of B relative to C is = +%1.3f mm 0.0217 inch
Displacement of B relative to C is 0.00217 inch


## Example 4.2 Page no 127¶

In [16]:
#Given
a_ab = 400.0      #mm**2, area
d_rod = 10.0      #mm
r_rod = d_rod/(2*1000) #radius in m
E_st = 200*(10**9) #Pa, pressure
E_al = 70*(10**9) #Pa
l_ab = 400.0      #mm, length of ab
l_bc = 600.0      #mm  length of bc

#Calculations
#Displacement
#delta =PL/AE
import math
numerator1 = P*(10**3)*(l_bc/1000.0)
denominator1 = (math.pi*r_rod**2*E_st)
delta_cb = numerator1/denominator1 #to the right
numerator2 = -P*(10**3)*(l_ab/1000.0)
denominator2 = (a_ab* 10**-6 *E_al)
delta_a = -numerator2/denominator2 #to the right
delta_c = delta_a+delta_cb

#Display
print"The displacement of C with respect to B     = ",round(delta_cb,4),"m"
print"The displacement of B with respect to A     = ",round(delta_a,4),"m"
print'The displacement of C relative to A         = ',round(delta_c*1000,2),"mm"

The displacement of C with respect to B     =  0.0031 m
The displacement of B with respect to A     =  0.0011 m
The displacement of C relative to A         =  4.2 mm


## Example 4.3 Page no 128¶

In [24]:
#Given
d_ac = 20.0                  #mm, ac diameter
r_ac = d_ac/(2*1000)		 #radius in m
d_bd =40.0 			     #mm
r_bd = d_bd/(2*1000) 		#radius in m
P = 90.0 				#kN
E_st = 200*(10**9) 		#Pa
E_al = 70*(10**9) 		#Pa
l_af = 200.0 			#mm
l_fb = 400.0 			#mm
l_bd = 300.0			#mm
l_ac = l_bd

#Calculations
#Internal Force
P_ac = 60 #kN
P_bd = 30 #kN
#Displacement
import math
num1 = -(P_ac*10**3*(l_ac/1000.0))
denom1 = math.pi* r_ac**2*E_st
delta_a = -num1/denom1
delta_a = delta_a*1000
#Post BD delta = PL/AE
num2 = -(P_bd*10**3*(l_bd/1000))
denom2 = math.pi* r_bd**2*E_al
delta_b = -num2/denom2
delta_b = delta_b*1000
delta_f = delta_b + (0.184)*(l_fb/(l_af+l_fb))

#Display
print'The displacement of Post AC       =',round(delta_a,3),"mm downwards"
print'The displacement of Post BD       =',round(delta_b,3),"mm downwards"
print'nThe displacement of point F      =',round(delta_f,3),"mm downwards"

The displacement of Post AC       = 0.286 mm downwards
The displacement of Post BD       = 0.102 mm downwards
nThe displacement of point F      = 0.225 mm downwards


## Example 4.5 Page no 139¶

In [11]:
#Given
import math
d_ab = 5           #mm, ab diameter
A = (math.pi/4)*(d_ab/1000)**2
gap = 1           #mm
P = 20            #kN, pressure
E_st = 200        #GPa
l_ac = 0.4        #m
l_cb = 0.8        #m
l_ab = l_ac+l_cb

#Calculations
#Equilibrium
#  Eqn1 -Fa - Fb +P*10**3 = 0
#Compatibility
delta_ba = gap/1000.0 #in m
delta = delta_ba*(A*E_st*10**9) #delta_ba* Lac/AE

#Eqn2 (L/AE)*Fa -(Lb/AE)*Fb = delta_ba
#Solving Equations 1 and 2 by matrices
Fa=16            #KN
Fb=4.05          #KN

#Display
print"The reaction force at A = ",Fa,"kN"
print"The reaction force at B = ",Fb,"kN"

The reaction force at A =  16 kN
The reaction force at B =  4.05 kN


## Example 4.6 Page no 140¶

In [7]:
#Given
E_al = 10        #ksi,
E_br = 15        # ksi
h = 1.5 	     #ft
ri = 1 	         #inch
ro = 2 	         #inch

#Calculations
import math
A = (math.pi*(ro**2 -ri**2))
Ai = math.pi*ri**2
#Equilibrium Eqn1 F_al +F_br = P
#Compatibility
coeff_F_br = (A*E_al)/(Ai*E_br)
#Eqn2  F_al- (coeff_F_br*F_br) = 0
#Solving equations 1 and 2 using matrices
Fal=6
Fbr=3

avg_stress_al = Fal/A
avg_stress_br = Fbr/Ai
avg_stress_al = avg_stress_al/1000
avg_stress_br = avg_stress_br/1000

#Display
print"The axial force experienced by Al     = ",Fal,"ksi"
print"The axial force experienced by Brass  = ",Fbr,"ksi"
print'The average normal stress in Al       = ',round(avg_stress_al*1000,3),"ksi"
print'The average normal stress in Al Brass = ',round(avg_stress_br*1000,3),"ksi"

The axial force experienced by Al     =  6 ksi
The axial force experienced by Brass  =  3 ksi
The average normal stress in Al       =  0.637 ksi
The average normal stress in Al Brass =  0.955 ksi


## Example 4.7 Page no 141¶

In [10]:
#Given
a_ab = 50 	#mm**2, area
a_ef =a_ab
a_cd = 30 	#mm**2, area
l_ef = 0.5 	#m, ef length
l_ce = 0.4 	#m
l_ac = 0.4 	#m

#Calculations
#In the y direction    F_a +F_c +F_e = P
#of moments -F_a(l_ac)+ P(l_ac/2) +F_e(l_ce) = 0

#Compatibility equation for displacemnts
coeff_Fc = (1/a_cd) #coefficient of Fc
coeff_Fa = (0.5/a_ab) #coefficient of Fc
coeff_Fe = (0.5/a_ef) #coefficient of Fc

#Solving the 3 Equations
F_a=9.52
F_b=3.46
F_c=2.02
#Display
print"The force in rod AB       = ",F_a,"kN"
print'The force in rod CD       = ',F_b,"kN"
print'The force in rod EF       = ',F_c,"kN"

The force in rod AB       =  9.52 kN
The force in rod CD       =  3.46 kN
The force in rod EF       =  2.02 kN


## Example 4.8 Page no 142¶

In [14]:
#Given
r_o = 0.5		 #inch, outside radius
r_i = 0.25		#inch, inside radius
l = 3 			#inch

#calculations
import math
a_t = (math.pi)*(r_o**2 - r_i**2) #Area of thread
a_b = (math.pi*(r_i**2))# Area of bolt
# In Y direction F_b - F_t = 0

#Compatibility
half_turn = one_turn/2.0
#Solving the two simultaneous equations for F_b and F_t
F_b =11.22       #kip
F_t = F_b
stress_b = F_b/a_b
stress_t = F_t/a_t
F_b = F_b/1000.0
F_t = F_t/1000.0

#Display
print'The stress in the bolt ',round(stress_b,1),"ksi"
print'The stress in the screw   ',round(stress_t,1),"ksi"

The stress in the bolt  57.1 ksi
The stress in the screw    19.0 ksi


## Example 4.9 Page no 144¶

In [22]:
#Given
import math
l_ab = 800 + 400		#mm, ab length
d = 5/1000.0 			#m, diameter
area = (math.pi/4.0)*d**2 	#Cross sectional area
l_bbdash = 1/1000.0		#m
E = 200.0 			#GPa

#Calculations
#Compatibility
delta_p = (P*10**3*0.4)/(area*E*10**9) #delta = PL/AE
delta_b = delta_p-l_bbdash
F_b = (delta_b*area*E*10**9)/(l_ab/1000.0)
F_b = F_b/1000.0

#Equilibrium
F_a = P - F_b

#Display
print"The reaction at A ",round(F_a,2),"kN"
print'The reaction at B',round(F_b,2),"kN"

The reaction at A  16.61 kN
The reaction at B 3.39 kN


## Example 4.10 Page no 152¶

In [27]:
#Given
T1 = 60		 #degree celcius
T2 = 120		#degress celcius
l_ab = 0.5		#m
area =l_ab**2 	#m**2
alpha = 6.6*10**-6	# per degree celcius
E = 29*10**6 		#kPa

#Equilibrium
#F_a = F_b = F
del_T = T2-T1
F = alpha*del_T*area*E                   #Thermal Stress Formula
avg_normal_comp_stress = (F*10**-3)/area # sigma = F/A

#Display
print"The force at A and B   = ",F/1000,"kip"
print'The average normal compressive stress  = ',avg_normal_comp_stress,"ksi"

The force at A and B   =  2.871 kip
The average normal compressive stress  =  11.484 ksi


## Example 4.12 Page no 154¶

In [44]:
#Given
area_sleeve = 600*10**-6     #m**2, area
area_bolt = 400*10**-6       #m**2, area
T1 = 15                      #degree celcius
T2 = 80                      #degree celcius
alpha_bolt = 12*10**-6       #per degree celcius
alpha_sleeve = 23*10**-6     #per degree celcius
l = 0.15                    #m
E_bolt = 200*10**9 #N/m**2
E_sleeve = 73.1*10**9 #N/m**2

#Equilibrium
#F_s = F_b

#Compatibility
del_T = T2 - T1
delb_T = alpha_bolt*del_T*l
delb_F = l/(area_bolt*E_bolt)
dels_T = alpha_sleeve*del_T*l
dels_F = l/(area_sleeve*E_sleeve)

#delb_T + F_b*delb_F = dels_T + F_s*dels_F
F_b = (dels_T-delb_T)/(delb_F+dels_F)
F_b = F_b/1000 #in kN
F_s= F_b

#Display
print"The force experienced by sleeve and bolt, Fs=Fb ",round(F_s,1),"kN"

The force experienced by sleeve and bolt, Fs=Fb  20.3 kN


## Example 4.13 Page no 165¶

In [36]:
#Given
yiel = 250      #MPa, yield stress
width = 40       #mm
thick = 2       #mm

#a)
r_h = r/(width - (2*r))
w_h = width/(width - (2*r))
K = 1.75
area = (thick*(width - (2*r))*10**-6)
P_y = (yiel*10**6*area)/K
P_y = P_y/1000.0
#b)
P_p = (yiel*10**6*area)
P_p = P_p/1000.0

#Display
print"The maximum load P that does not cause the steel to yield ",round(P_y,2),"kN"
print'The maximum load that the bar can support ',P_p,"kN"

The maximum load P that does not cause the steel to yield  9.14 kN
The maximum load that the bar can support  16.0 kN


## Example 4.14 Page No:166¶

In [17]:
#Given:
sigmaY= 420       #MPa, bending stress
E = 70*10**6       #MPa
l1 = 0.1           #m
l2 = 0.3           #m
r=0.005         #m

#Maximum Normal Stress:
#r_h = 6/20.0
#w_h = 40/20.0
#K = 1.6
#from sec 4.4
Fa=45
Fb=15
sigmaAC=(Fa/1000.0)/((math.pi)*r**2)
sigmaCB=(Fb/1000.0)/((math.pi)*r**2)
Fay=sigmaY*10**3*(math.pi)*r**2
Fb=P-Fay
if sigmaAC>sigmaY:
print"Calculate sigmaAC again"
else:
print"It is OK"
sigmaAC_=sigmaY
sigmaCB_=Fb/1000.0/((math.pi)*r**2)
if sigmaCB_<sigmaY:
print"It is OK"
else:
print"Calculate sigmaAC again"
dL=Fb*l2/(((math.pi)*r**2)*E)
epsilonCB=dL/l2
epsilonAC=dL/l1
epsilonY=sigmaY*10**6/(E*10**3)
sigmaACr=-sigmaAC_+sigmaAC
sigmaCBr=sigmaCB_-sigmaCB

#Display:
print"Residual stress in AC is",round(sigmaACr,0),"MPa"
print"Residual stress in CB is",round(sigmaCBr,0),"MPa"

Calculate sigmaAC again
It is OK
420
572.957795131
190.98593171
343.943726841
Residual stress in AC is 153.0 MPa
Residual stress in CB is 153.0 MPa


## Example 4.15 Page no 168¶

In [10]:
#Given
weight = 3.0           #kip, weight
l_ab = 20.0            #ft, length
l_ac= 20.03          #ft
area = 0.05          #inch**2, area
sigmaY=50               #ksi

#calculations
strain_ab = (l_ac-l_ab)/l_ab
max_strain = 0.0017
stress_ab = (350*strain_ab)/max_strain
F_ab = stress_ab*area
E_st = 350/max_strain
del1 = l_ab/(area*10**-6*E_st*10**3)
del2 = l_ac/(area*10**-6*E_st*10**3)

T_ab=sigmaY*area
T_ac = weight-T_ab            #kip
stress_in_ab = (T_ab*10**3)/area
stress = (T_ac)/area
strain_ac = (stress*max_strain)/50.0
elong_ac = strain_ac*l_ac       #m
elong_ab = (l_ac-l_ab)+elong_ac #m

#Display
print'The force experienced by wire AB  = ',T_ab,"kip"
print'The force experienced by wire AC  = ',T_ac,"kip"
print'The elongation in wire AB         = ',round(elong_ab,4),"ft"
print'The elongation in wire AC         = ',round(elong_ac,5),"ft"

The force experienced by wire AB  =  2.5 kip
The force experienced by wire AC  =  0.5 kip
The elongation in wire AB         =  0.0368 ft
The elongation in wire AC         =  0.00681 ft