Chapter10-Stresses in a Soil Mass

Ex1-pg257

In [1]:
import math
#principal stress and normal stresses and shear stresses
##initialisation of variables
sx= 2000. ##lb/ft^3
sy= 2500. ##lb/ft^3
T= 800. ##lb/ft^3
t= 0.348##radians
##calculations
s1= (sx+sy)/2.+math.sqrt(((sy-sx)/2.)**2+T**2)
s2= (sx+sy)/2.-math.sqrt(((sy-sx)/2.)**2+T**2)
sn= (sx+sy)/2.+(sy-sx)*math.cos(2.*t)/2.-T*math.sin(2*t)
Tn= (sy-sx)*math.sin(2.*t)/2.+T*math.cos(2*t)
##results
print'%s %.2f %s'% ('principle stress s1 = ',s1,' lb/ft^3 ')
print'%s %.2f %s'% ('principle stress s2 = ',s2,' lb/ft^3 ')
print'%s %.2f %s'% ('normal stress = ',sn,' lb/ft^3 ')
print'%s %.2f %s'% ('shear stress = ',Tn,' lb/ft^3 ')
principle stress s1 =  3088.15  lb/ft^3 
principle stress s2 =  1411.85  lb/ft^3 
normal stress =  1928.93  lb/ft^3 
shear stress =  774.22  lb/ft^3 

Ex3-pg262

In [2]:
import math
#calculate vertical stress increase
##initialisation of variables
x= 3. ##m
y= 4. ##m
P= 5. ##kN
z= 2. ##m
##calculations
r= math.sqrt(x**2+y**2)
k= r/z
I= 3./(2.*math.pi*((r/z)**2+1)**2.5)
s= P*I/z**2
##results
print'%s %.4f %s'% ('verticle stress increase at 2m = ',s,' kN/m^3 ')
verticle stress increase at 2m =  0.0042  kN/m^3 

Ex6-pg270

In [2]:
#calculate the value of pressure and plot the graph
import math
%matplotlib inline
import warnings
warnings.filterwarnings('ignore')
from math import log
import numpy
from math import tan
import matplotlib
from matplotlib import pyplot
#given
p=numpy.array([-9,-6,-3, 0,3,6,9])
e=numpy.array([0.017,0.084,0.480,0.818,0.480,0.084,0.017])

#calculations


#results

pyplot.plot(p,e)
pyplot.xlabel('Pressure (ton/ft^2)')
pyplot.ylabel('void ratio ,e')
pyplot.title('Graph of pressure vs void ratio')
pyplot.show()