import math
#Calculate the lateral force Poper unit length of the wall. Also, determine the location ofthe resultant force. Assume that for sand OCR2
OCR=2.
a=30.
Ko=(1.-math.sin(a/57.3))*(OCR)**math.sin(a/57.3)
##at z=0
To1=0.
Th1=0.
u1=0.
##at z=10
To2=10.*100.
Th2=Ko*To2
u2=0.
##at z=15
To3= 10.*100.+5.*(122.4-62.4)
Th3=Ko*To3
u3=5.*62.4
##Lateral force Po =Area 1 + Area 2+ Area3+ Area 4
Po =(1./2.)*10.*707.+5.*707.+(1./2.)*5.*212.1+(1/2.)*5.*312.
z=((3535.)*(5.+10./3.)+3535.*(5./2.)+530.3*(5./3.)+780.*(5./3.))/Po
print'%s %.1f %s'%('z = ',z,' ft')
import math
#a.Rankine active force per unit length of the wall and the location of theresultant
#b.Rankine passive force per unit length of the wall and the location of the resultant
##c=0
a=36.
G=16.
Ka=(1.-math.sin(a/57.3))/(1.+math.sin(a/57.3))
##at z=0 Tp=0
z=6.
To=G*z
Ta=Ka*To
Pa=z*Ta/2.
print'%s %.1f %s'%('a)Rankine active force per unit length of the wall = ',Pa,' kN/m')
print(' and the location of the resultant is z = 2m')
p=36.
G=16.
Kp=(1+math.sin(a/57.3))/(1-math.sin(a/57.3))
##at z=0 Tp=0
z=6.
To=G*z
Tp=Kp*To
Pp=z*Tp/2.
print'%s %.1f %s'%(' b)Rankine passive force per unit length of the wall = ',Pp,' kN/m')
print (' and the location of the resultant is z = 2m')
import math
#Determine the active force Paperunit length of the wall as well as the location and direction of the resultant.
H=12.
a=20.
b=20.
G=115.
c=30.
Oa= math.asin(math.sin(a/57.3)/math.sin(c/57.3))*57.3-a+2.*b
Ka= (math.cos((a-b)/57.3)*math.sqrt(1.+(math.sin(c/57.3))**2.-2.*math.sin(c/57.3)*math.cos(Oa/57.3)))/((math.cos(b/57.3))**2.*(math.cos(a/57.3)+math.sqrt((math.sin(c/57.3))**2.-(math.sin(a/57.3))**2)))
Pa=G*H**2.*Ka/2.
B= math.atan((math.sin(c/57.3)*math.sin(Oa/57.3))/(1.-(math.sin(c/57.3)*math.cos(Oa/57.3))))*57.3
print'%s %.1f %s'%('The active force Pa per unit length of the wall = ',Pa,' lb/ft')
print'%s %.1f %s'%( ' The resultant will act a distance of 12/3 = 4 ft above the bottom of the wall with B = ',B,' degree')
import math
#determine the force per unit length of the wall for Rankine’s active state. Also find the location of the resultant.
a=30.
Ka1=(1.-math.sin(a/57.3))/(1.+math.sin(a/57.3))
a=35.
Ka2=(1-math.sin(a/57.3))/(1+math.sin(a/57.3))
##at z=0 so T0=0
##atz=3
To=3.*16.
Ta1=Ka1*To
Ta2=Ka2*To
## At z=6
To=3.*16.+3.*(18.-9.81)
Ta2=Ka2*To
Pa =(1/2.)*3.*16.+3.*13.0+ (1/2.)*3.*36.1
z= (24 *(3.+3./3.)+39.0*(3/2.)+54.15*(3/3.))/Pa
print'%s %.1f %s'%('The force per unit length of the wall = ',Pa,' kN/m')
print'%s %.1f %s'% (' The location of the resultant = ',z,'m ')
import math
#a.Maximum depth of the tensile crack
#b.Pabefore the tensile crack occurs
#c. Pa after the tensile crack occurs
Ka= (math.tan(1./57.3))**2.
G=16.5
cu=10.
H=6.
##at z=0
z=0.
Ta=G*z-2.*cu
##zt z=6
z=6.
Ta=G*z-2.*cu
zo=2.*cu/G
## Before the tensile crack occurs
Pa= G*H**2./2. - 2.*cu*H
print'%s %.1f %s'%('Pa before the tensile crack occurs = ',Pa,' kN/m')
##After the tensile crack occurs
Pa=(H-zo)*Ta/2.
print'%s %.1f %s'%(' Pa after the tensile crack occurs = ',Pa,' kN/m')
import math
#Determine the Rankine active force Paon the retaining wall after the tensile crack occurs.
H=15.
a=10.
G=118.
b=20.
C=250
Zo=2.*C*math.sqrt((1+math.sin(b/57.3))/(1.-math.sin(b/57.3)))/G
##at z=0 Ta=0
##at z=15
z=15.
K=0.3
Ta=G*z*K*math.cos(a/57.3)
Pa=(H -Zo)*Ta/2.
print'%s %.1f %s'%('The Rankine active force Pa on the retaining wall after the tensile crack occurs = ',Pa,' lb/ft')
#Estimate the active force,Pa , per unit length of the wall. Also, state the direction and location of the resultant force,Pa.
import math
c=30.
b=15.
a=10.
Ka=0.3872 ## from table 13.8
H=4.
G=15.
Pa=G*H**2.*Ka/2.
print'%s %.1f %s'%('The active force per unit length Pa = ',Pa,' kN/m')
print(' The resultant will act at a vertical distance equal to H/3 = 4/3 = 1.33 m above ' ' the bottom of the wall and will be inclined at an angle of 15to the back face of the wall.')
import math
#Determine Pae.Also determine the location of the resultant line of action of Pae—that is, .
kh=0.2
kv=0.
H=4.
a=0.
b=0.
c=15.
d=30.
G=15.5
B= math.atan(kh/(1-kv)/57.3)
b1=b+B
a1=a+B
Ka=0.452
Pa=G*H**2.*Ka/2.
Pae=Pa*(1.-kv)*((math.cos(b1/57.3))**2./((math.cos(b/57.3))**2.*(math.cos(B/57.3))**2.))
Ka=0.3014
Pa=G*H**2*Ka/2.
P1=Pae-Pa
z= ((Pa*H/3)+P1*0.6*H)/Pae
print'%s %.1f %s'%('Pae = ',Pae,' kN/m')
print'%s %.1f %s'%(' Z = ',z,' m')
import math
#Determine the magnitude of the active force,Pae.
H=28.
C=210.
b=10.
G=118.
c=20.
kh=0.1
Ka=math.tan(35./57.3)
zo=2.*C/(G*(Ka))
n=zo/(H-zo)
Nac=1.60
Nav=0.375
L=1.17
Pae= G*(H-zo)**2*(L*Nav)-C*(H-zo)*Nac
print'%s %.1f %s'%('The magnitude of the active force, Pae = ',Pae,' lb/ft')