--> //initializations

--> Yw=10 //KN/m^3 (unit weight of water)
 Yw  = 

   10.


--> Y1=16 //KN/m^3 (unit weight in section AB)
 Y1  = 

   16.


--> Y2=19 //KN/m^3 (unit weight in section BC)
 Y2  = 

   19.


--> c1=0 //KN/m^2 (cohesion in section AB)
 c1  = 

   0.


--> c2=10 //KN/m^2 (cohesion in section BC)
 c2  = 

   10.


--> x1=30 // (angle of shearing resistance in section AB)
 x1  = 

   30.


--> x2=24 // (angle of shearing resistance in section BC)
 x2  = 

   24.


--> z1=0 //m (height at point A)
 z1  = 

   0.


--> z2=2 //m (difference between A and B)
 z2  = 

   2.


--> z3=2 //m (difference between B and C)
 z3  = 

   2.


--> //calculations

--> Kp1=(1+sin((x1*%pi)/180))/(1-sin((x1*%pi)/180)) //(coefficient of passive pressure at top layer)
 Kp1  = 

   3.


--> Kp2=(1+sin((x2*%pi)/180))/(1-sin((x2*%pi)/180)) //(coefficient of passive pressure at bottom layer)
 Kp2  = 

   2.3711841


--> Pp1=(Kp1*Y1*z1)+(2*c1*sqrt(Kp1)) //KN/m^2 (stress at point A)
 Pp1  = 

   0.


--> Rv1=z2*Y1 //KN/m^2 (effective stress in section AB)
 Rv1  = 

   32.


--> Pp2=Kp1*Rv1 //KN/m^2 (stress at point B in section AB)
 Pp2  = 

   96.


--> Pp3=(Rv1*Kp2)+(2*c2*sqrt(Kp2)) //KN/m^2 (stress at point B in section BC)
 Pp3  = 

   106.67519


--> Rv2=(z2*Y1)+(z3*(Y2-Yw)) //KN/m^2 (effective stress in section BC)
 Rv2  = 

   50.


--> Pp4=(Rv2*Kp2)+(2*c2*sqrt(Kp2)) //KN/m^2 (stress at point C)
 Pp4  = 

   149.3565


--> u=z2*Yw //KN/m^2 (pore water pressure)
 u  = 

   20.


--> P1=(z2*Pp2)/2 //KN
 P1  = 

   96.


--> P2=Pp3*z2 //KN
 P2  = 

   213.35038


--> P3=(z3*(Pp4-Pp3))/2 //KN
 P3  = 

   42.681314


--> P4=(z3*u)/2 //KN
 P4  = 

   20.


--> P=P1+P2+P3+P4 //KN (total pressure)
 P  = 

   372.0317


--> //results

--> printf('passive force per unit length of the wall=%f',P) //KN
passive force per unit length of the wall=372.031695
