#example 6.1
B=30; # in ft
L=45; # in ft
Df=6.5; # in ft
cu=1950;# in lb/ft^2
qunet=5.14*cu*(1+0.195*B/L)*(1+0.4*Df/B);
print int(qunet)," is allowed force in lb/ft**2"
#example 6.2
N60=10; # penetration number
Df=2; # in m
B=10.0; # in m
Se=25.0; # in mm
qnetall=N60/0.08*(1+0.33*Df/B)*Se/25;
print qnetall," is allowed pressure in kN/m**2"
#example 6.3
cu=2800; # in lb/ft^2
B=60; # in ft
L=100; # in ft
Df=5; # in ft
Gamma=120; # in lb/ft^3
A=60*100; # in ft^2
Q=25e6; # load in Kip
FS=5.14*cu*(1+0.195*B/L)*(1+0.4*Df/B)/(Q/A-Gamma*Df);
print round(FS,2)," is factor of safety"
#example 6.4
import math
Cc=0.28;
Hc=18*12.0;
e0=0.9;
sigmao=11*100+40*(121.5-64)+18/2*(118-62.4); # in lb/ft^2
H2=5+40+18.0;
H1=5+40.0;
qo=3567.0;
#from table
IaH2=0.21;
IaH1=0.225;
Dsigma=qo*((H2*IaH2-H1*IaH1)/(H2-H1))*4;
Scp=Cc*Hc/(1+e0)*math.log10(sigmao/sigmao+Dsigma/sigmao);
print round(Scp,2),"is settlement in inches"
# The answers in the book are different due to approximation while here calculations are precise
#example 6.5
import numpy
P=['A','B','C','D','E','F','G','H','I','J','K','L','M','N'];#point
k=1.2*numpy.ones(14);#Q/A
x=[-38,-24, -12, 0, 12, 24, 38, 38, 24, 12, 0, -12, -24, -38];
x1=numpy.zeros(14)
for i in range(0,14):
x1[i]=0.0017*x[i];
y=[48,48,48,48,48,48,48, -48, -48, -48, -48, -48, -48, -48];
y1=numpy.zeros(14)
for i in range(0,14):
y1[i]=-0.0011*y[i];
print "point\t Q\A (kip/ft**2) x(ft)\t 0.0017x(ft)\t\ty(ft)\t \t 0.0011y(ft)\t \t q(kip/ft**2)\n"
q=numpy.zeros(14)
for i in range(0,14):
q[i]=1.2+x1[i]+y1[i];
print P[i],"\t ",k[i],"\t\t ",x[i],"\t\t",round(x1[i],3),"\t\t",y[i],"\t \t ",round(y1[i],3),"\t \t \t",round(q[i],3),"\t\t \n "
print "the soil pressure at all point is less than the given qallnet=1.5 kip/ft**2"
#example 6.6
from scipy.optimize import fsolve
#solving for d
def f(d):
return (96+2*d)*d-2615.1
[x]=fsolve(f,19);
d1=x;
def f(d):
return (96+4*d)*d-6046.4
[x]=fsolve(f,28);
d2=x;
d=max(d2,d1);
d=round(d)
#now coming to design part
h=d+3+1; #in inch
print h,"is total slab thickness in inches"
qa=1.082; # in kip/ft^2
qb=1.106; # in kip/ft^2
qm=1.212; # in kip/ft^2
qn=1.188; # in kip/ft^2
q1A=qa/2.0+qb/2.0;
print round(q1A,3),"is force in strip ABMN in kip/ft**2"
q2A=qm/2.0+qn/2.0;
print round(q2A,3),"is force in strip ABMN in kip/ft**2"
q1=1.106/3+1.127/3+1.147/3;
print round(q1,3),"is force in strip BCDKLM in kip/ft**2"
q2=1.253/3+1.233/3+1.212/3;
print round(q2,3),"is force in strip BCDKLM in kip/ft**2"
q1=1.147/3+1.167/3+1.188/3;
print round(q1,3),"is force in strip DEFIJK in kip/ft**2"
q2=1.294/3+1.273/3+1.253/3;
print round(q2,3),"is force in strip DEFIJK in kip/ft**2"
q1=1.188/2+1.212/2;
print round(q1,3),"is force in strip FGHI in kip/ft**2"
q2=1.318/2+1.294/2;
print round(q2,3)," is force in strip FGHI in kip/ft**2"
#checking for force
#net soil reaction <load
netforce=1/2.0*(1.094+1.2)*14*96+1/2.0*(1.127+1.233)*24*96+1/2.0*(1.167+1.273)*24*96+1/2.0*(1.2+1.306)*14*96;
if netforce<8761 :
print "forces generated is OK"
#checking for reinforcement requirement
Q1=1.4*180+1.7*120;
Q2=1.4*360+1.7*200;
Q3=1.4*400+1.7*240;
Q4=1.4*180+1.7*120;
#solving for a
def f(a):
return 0.9*0.51*a*60*(29-a/2)-95.05*12
[x]=fsolve(f,1.4);
a=x;
As=0.51*a
fy=60000;
print round(As,2),"is required area in in**2"
Asmin=200.0/fy*12*29;
print Asmin," is minimum reinforcement required in**2/ft"
print "use No 9 bars at 10 inch centre to centre"