--> //initializations

--> T1=3.5 //m (thickness of sand layer)
 T1  = 

   3.5


--> T2=3 //m (thickness of clay layer)
 T2  = 

   3.


--> T3=3.5 //m (thicknesss of gravel layer)
 T3  = 

   3.5


--> D1=1.65 //Mg/m^3 (bulk density)
 D1  = 

   1.65


--> D2=1.95 //Mg/m^3 (bulk density)
 D2  = 

   1.95


--> D3=1.925 //Mg/m^3 (bulk density)
 D3  = 

   1.925


--> r1=58.86 //KN/m^2 (surcharge load)
 r1  = 

   58.86


--> g=9.81
 g  = 

   9.81


--> //calculations

--> //Section A-A

--> u1=0 //(pour water pressure)
 u1  = 

   0.


--> R1=r1-u1 //(effective pressure)
 R1  = 

   58.86


--> //Section B-B

--> r2=r1+(T1*D1*g) //(total stress)
 r2  = 

   115.51275


--> u2=0 //(pour water pressure)
 u2  = 

   0.


--> R2=r2-u2 //(effective pressure)
 R2  = 

   115.51275


--> //Section C-C

--> r3=r2+(T2*D2*g) //(total stress)
 r3  = 

   172.90125


--> u3=T2*g //(pour water pressure)
 u3  = 

   29.43


--> R3=r3-u3 //(effective pressure)
 R3  = 

   143.47125


--> //Section D-D

--> r4=r3+(T3*D3*g) //(total stress)
 r4  = 

   238.99613


--> u4=(T2+T3)*g //(pour water pressure)
 u4  = 

   63.765


--> R4=r4-u4 //(effective pressure)
 R4  = 

   175.23113


--> //results

--> printf('effective pressure at A-A=%f',R1) //KN/m^2
effective pressure at A-A=58.860000
--> printf('effective pressure at B-B=%f',R2) //KN/m^2
effective pressure at B-B=115.512750
--> printf('effective pressure at C-C=%f',R3) //KN/m^2
effective pressure at C-C=143.471250
--> printf('effective pressure at D-D=%f',R4) //KN/m^2
effective pressure at D-D=175.231125
