
--> //initializations

--> z1=0 //m (at top layer)
 z1  = 

   0.


--> z2=5 //m (at bottom layer)
 z2  = 

   5.


--> x=30 // (angle of shearing resistance)
 x  = 

   30.


--> c=5 //KN/m^2 (cohesion)
 c  = 

   5.


--> Y=17.5 //KN/m^3 (unit weight)
 Y  = 

   17.5


--> Pa=0 // (active earth pressure at point B)
 Pa  = 

   0.


--> //calculations

--> Ka=(1-sin((x*%pi)/180))/(1+sin((x*%pi)/180)) //(coefficient of active pressure)
 Ka  = 

   0.3333333


--> Pat=Ka*Y*z1-2*c*sqrt(Ka) //(active earth pressure at top layer)
 Pat  = 

  -5.7735027


--> Pab=Ka*Y*z2-2*c*sqrt(Ka) //(active earth pressure at bottom layer)
 Pab  = 

   23.393164


--> z=(Pa+2*c*sqrt(Ka))/(Ka*Y) //(distance from top layer to B point)
 z  = 

   0.9897433


--> D=z2-z // (distance from bottom layer to B point)
 D  = 

   4.0102567


--> //Before formation of crack

--> pa1=(z*Pat)/2 // (pressure at B point)
 pa1  = 

  -2.8571429


--> printf('NOTE: negative sign indicates negative pressure')
NOTE: negative sign indicates negative pressure
--> Pa1=-(pa1) // (negative pressure)
 Pa1  = 

   2.8571429


--> Pa2=(D*Pab)/2 // (positive pressure)
 Pa2  = 

   46.906296


--> Pan=Pa2-Pa1 // (total pressure)
 Pan  = 

   44.049153


--> Z=(((Pa2*D)/3)-(Pa1*(D+(1-Ka))))/Pan // (line of action of total pressure)
 Z  = 

   1.1201


--> //after formation of crack

--> printf('after the formation of crack the negative pressure is eliminated. The pressure distribution is given by the area bed \n It will act at a height of 4.01/3 m above base.')
after the formation of crack the negative pressure is eliminated. The pressure distribution is given by the area bed 
 It will act at a height of 4.01/3 m above base.
--> Paa=((Y*z2^2*Ka)/2)-(2*c*z2*sqrt(Ka))+((2*c^2)/Y) // (pressure)
 Paa  = 

   46.906296


--> //results

--> printf('active pressure on the wall before formation of crack=%f',Pan) //KN
active pressure on the wall before formation of crack=44.049153
--> printf('active pressure on the wall after formation of crack=%f',Paa) //KN
active pressure on the wall after formation of crack=46.906296
