#example 9.1
import math
from scipy.optimize import fsolve
sall=30;#sigma allowed
pi=math.pi;
zbar=12.1; # in ft
L1=10.0; # in ft
L2=20.0; #in ft
Gamma=0.12; # in lb/ft^3
Gamma1=0.1294-0.0624; # in lb/ft^3
phi=40*pi/180; # angle given
Ka=(math.tan(pi/4-phi/2))**2;
Kp=(math.tan(pi/4+phi/2))**2;
s1=Gamma*L1*Ka;#sigma1 in Kip/ft
s2=Gamma*L1*Ka+Gamma1*L2*Ka;#sigma2 in Kip/ft
L3=s2/(Gamma1*(Kp-Ka)); # in ft
print round(L3,2),"is length in ft"
P=1/2.0*s1*L1+s1*L2+1/2.0*(s2-s1)*L2+1/2.0*s2*L3;# in Kip/ft
print round(P,2)," is force in kip/ft"
s5=Gamma*L1*Kp+Gamma1*L2*Kp+Gamma*L3*(Kp-Ka);#sigma5 in Kip/ft
print round(s5,2)," is pressure in kip/ft"
A1=s5/(Gamma1*(Kp-Ka)); # in ft^2
A2=8.0*P/(Gamma1*(Kp-Ka)) # in ft^2
A3=6.0*P*(2.0*zbar*(Gamma1*(Kp-Ka))+s5)/(Gamma1*(Kp-Ka))**2.0 # in ft^2
A4=P*(6.0*zbar*s5+4.0*P)/(Gamma1*(Kp-Ka))**2.0 # in ft^2
print "A1,A2,A3,A4 respectively is ",round(A1,1),round(A2,2),round(A3,2),round(A4,2)
print "slight error due to rounding off error"
#part(b)
def f(x):
return x**4+41.7*x**3-270.5*x**2-13363*x-106863
[x]=fsolve(f,20);
D=1.88+x;
print round(D,2)," is value of D, in ft"
TL=L1+L2+1.3*D;
print round(TL,2)," is total length in ft"
#partc
z=math.sqrt(2*P/(Gamma1*(Kp-Ka)));#zdash
Mmax=P*(z+zbar)-1/2.0*(Gamma1*(Kp-Ka))*z**2*z/3.0;
S=Mmax*12/sall;
print round(S,2),"is section modulus in in^3/ft"
# The answers in the book are different due to approximation while here calculations are precise
#example 9.2
import math
from scipy.optimize import fsolve
sall=172.5*1000;#sigma allowed in KN/m^2
pi=math.pi;
c=47.0; # in KN/m^2
zbar=1.78; # in m
L1=2.0; #in m
L2=3.0; # in m
Gamma=15.9; # in KN/m^3
Gamma1=19.33-9.81; # in KN/m^3
phi=32*pi/180;
Ka=(math.tan(pi/4-phi/2))**2;
Kp=(math.tan(pi/4+phi/2))**2;
s1=Gamma*L1*Ka;#sigma1 in KN/m^2
s2=Gamma*L1*Ka+Gamma1*L2*Ka;#sigma2 in KN/m^2
P=1/2.0*s1*L1+s1*L2+1/2.0*(s2-s1)*L2; # in kN/ft
print round(P,2)," is force in kN/m"
def f(x):
return 127.4*x**2-104.4*x-357.15
[x]=fsolve(f,2);
D=x;
print round(D,2)," is value of D in m"
print round(D*1.5,2),"actual D in m"
L4=D*(4*c-(Gamma*L1+Gamma1*L2)-P/D)/4/c;
print round(L4,2)," is length in m"
s6=4*c-(Gamma*L1+Gamma1*L2);#sigma6 in KN/m^2
s7=4*c+(Gamma*L1+Gamma1*L2);#sigma7 in KN/m^2
z=P/s6;#zdash
Mmax=P*(z+zbar)-1/2.0*s6*z**2; # in KN-m/m
S=Mmax*12.0/sall; # in m^3/m
print round(S,4)," is section modulus in m**3/m"
print "is slight error due to rounding off error"
# The answers in the book are different due to approximation while here calculations are precise
#example 9.3
import math
from scipy.optimize import fsolve
pi=math.pi;
zbar=2.23; # in m
L1=2.0; # in m
L2=3.0; # in m
Gamma=15.9; # in KN/m^3
Gamma1=19.33-9.81; # in KN/m^3
phi=32*pi/180;
Ka=(math.tan(pi/4-phi/2))**2;
Kp=(math.tan(pi/4+phi/2))**2;
s1=Gamma*L1*Ka;#sigma1 in KN/m^2
s2=Gamma*L1*Ka+Gamma1*L2*Ka;#sigma2 in KN/m^2
L3=s2/(Gamma1*(Kp-Ka)); # in m
print round(L3,2),"length in m"
P=1/2.0*s1*L1+s1*L2+1/2.0*(s2-s1)*L2+1/2.0*s2*L3;
print round(P,2),"force in kN/m"
def f(x):
return x**3+6.99*x**2-14.55
[x]=fsolve(f,1.4);
D=L3+x;
print round(D,2),"value of D in m"
AL=1.4*D;
print round(AL,2),"actual length in m"
#partb
L4=1.4;
F=P-1/2.0*(Gamma1*(Kp-Ka)*L4**2);
print round(F,2),"anchor force in kN/m"
#partc
def f(x):
return x**2+6.682*x-14.44
[x]=fsolve(f,1.7);
z=x+2;
Mmax=-1/2.0*s1*L1*(x+2/3.0)+F*(x+1)-s1*x*x/2-1/2.0*Ka*Gamma1*x**3/3.0;
print round(Mmax,2)," is maximum moment in kN-m/m"
# The answers in the book are different due to approximation while here calculations are precise
#example 9.4
Gamma=15.9; # in KN/m^3
Gamma1=19.33-9.81; # in KN/m^3
GD=0.23; # from fig. 9.16
CDL1=1.172; # from fig. 9.19
L1=2; # in m
L2=3; # in m
Dth=(L1+L2)*GD*CDL1;
print round(Dth,2),"theoritical depth in m"
Dac=1.4*Dth;
print round(Dac,2),"actual depth in m"
print "approximate it as 2 m"
#part(b)
CFL1=1.073;
GF=0.07;
Gammaa=(Gamma*L1**2+Gamma1*L2**2+2*Gamma*L1*L2)/(L1+L2)**2; # in KN/m^3
F=Gammaa*(L1+L2)**2*GF*CFL1; # in KN/m
print round(F,2),"force in kN/m"
#part(c)
GM=0.021; # from fig. 9.18
CML1=1.036; # from fig. 9.21
Mmax=Gammaa*(L1+L2)**3*GM*CML1; # in kN-m/m
print round(Mmax,2),"maximum moment in kN-m/m"
#example 9.5
import math
import matplotlib.pyplot as plt
import numpy
Mmax=43.72; # in kN-m/m
sp=["PSA-31","PSA-23"];#sheet pile
H=[7.9,7.9] # in m
I=[4.41e-6,5.63e-6]; # in m^4/m
p=[0.00466,0.00365];
S=[10.8e-5,12.8e-5]; # in m^3/m
Md=[18.63,22.08]; # kn-m/m
Logp=numpy.zeros(2)
k=numpy.zeros(2)
print "SheetPile I(m**4/m) H(m) p\t Logp S(m**3/m) Md(kN-m/m) Md/Mmax \n"
for i in range(0,2):
Logp[i]=math.log10(p[i]);
k[i]=Md[i]/Mmax;
print sp[i],"\t ",I[i]," ",H[i]," ",p[i]," ",round(Logp[i],2)," ",S[i]," ",Md[i],"\t ",round(k[i],3)
plt.plot(Logp,k);
plt.title("Ex9.5")
plt.xlabel("LogP")
plt.ylabel("Md/Mmax")
plt.show()
#example 9.6
import math
from scipy.optimize import fsolve
pi=math.pi;
R=0.6;
L1=10.0; # in ft
L2=20.0; #in ft
Gammasat=122.4; # in lb/ft^3
l1=5; # in ft
Gamma=110.0; # in lb/ft^3
C=0.68;
L=L1+L2; # in ft
Gammaw=62.4; # in lb/ft^3
Gamma1=Gammasat-Gammaw;#gammadash in lb/ft^3
Gammaav=(Gamma*L1+Gamma1*L2)/(L1+L2); # in lb/ft^3
phi=35.0*pi/180;
Ka=(math.tan(pi/4-phi/2))**2;
sa=C*Ka*Gammaav*L;#sigmaa in lb/ft^2
sp=R*sa;#sigmap # in lb/ft^2
def f(x):
return x**2+50*x-1000
[x]=fsolve(f,15);
D=x;#in ft
print round(D,2)," is depth in ft"
R=L/D*(L-2*l1)/(2*L+D-2*l1);
print "value of R=",round(R,2)," is OK\n"
#partb
F=sa*(L-R*D); # in lb/ft
print round(F,2)," is Force in lb/ft"
#partc
Mmax=0.5*sa*L**2*((1-R*D/L)**2-(2*l1/L)*(1-R*D/L)); # in lb-ft/ft
print round(Mmax,2),"maximum moment lb-ft/ft"
# The answers in the book are different due to approximation while here calculations are precise
#example 9.7
import math
from scipy.optimize import fsolve
pi=math.pi;
zbar=3.2; # in m
c=41; # in KN/m^2
L1=3; # in m
L2=6; # in m
Gamma=17;# in KN/m^3
Gamma1=20-9.81; # in KN/m^3
phi=35*pi/180;
Ka=(math.tan(pi/4-phi/2))**2;
Kp=(math.tan(pi/4+phi/2))**2;
s1=Gamma*L1*Ka;#sigma1 in kN/m**2
s2=Gamma*L1*Ka+Gamma1*L2*Ka;#sigma2 in kN/m**2
P=1/2.0*s1*L1+s1*L2+1/2.0*(s2-s1)*L2;
print round(P,2),"Force in kN/m"
s6=4*c-(Gamma*L1+Gamma1*L2);#sigma6 in kN/m**2
print round(s6,2),"pressure in kN/m**2"
def f(x):
return x**2+15*x-25.43
[x]=fsolve(f,1.6);
D=x; # in m
print round(D,1),"depth in m"
F=P-s6*D; # in kN/m
print round(F,2),"force in kN/m"
print "slight error due to rounding off"
#example 9.8
import math
pi=math.pi;
Gamma=105.0; # in lb/ft^3
Cov=14.0;
B=15/12.0; # in inch
Ka=0.26;
phi=35.0*pi/180; # given angle in degree
H=37.5/12; # in inch
h=15/12.0; # in inch
t=6/12.0; # in inch
Gc=150.0;#gamma concrete in lb/ft^3
W=H*t*Gc; # in lb/ft
k=4.5;#kp*cos(delta)
Pu=1/2.0*Gamma*H**2*(k-Ka*math.cos(phi)); # in lb/ft
print round(Pu,2),"force in lb/ft"
Pus=((Cov+1)/(Cov+H/h))*Pu; # in lb/ft
print round(Pus,2),"force in lb/ft"
Be=0.227*(H+h)+B;
Pu=Pus*Be; # in lb/ft
print round(Pu,2)," is resistance of anchor plate in lb/ft"
# The answers in the book are different due to approximation while here calculations are precise