--> //initializations

--> p=200 //KN/m^2 
 p  = 

   200.


--> Y1=16 //KN/m^2 (unit weight of sand)
 Y1  = 

   16.


--> Y2=15 //KN/m^2 (unit weight of clay)
 Y2  = 

   15.


--> Ys=18 //KN/m^2 (unit weight in saturation)
 Ys  = 

   18.


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

   10.


--> eo=0.8 // (void ratio in clay)
 eo  = 

   0.8


--> Cc=0.3 // (coefficient of compressibility)
 Cc  = 

   0.3


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

   3.


--> H2=1 //m (thickness between footing bottom to ground level)
 H2  = 

   1.


--> H3=1.5 //m (thickness between footing bottom to saturation)
 H3  = 

   1.5


--> Hs=0.5 //m (thickness of saturation state)
 Hs  = 

   0.5


--> d=1.5 //m (depth of footing)
 d  = 

   1.5


--> w=3 //m (width of footing)
 w  = 

   3.


--> //calculations

--> Ro=((H2+H3)*Y1)+(Hs*(Ys-Yw))+((H1/2)*(Y2-Yw)) //(initial pressure)
 Ro  = 

   51.5


--> dRt=(p*w*d)/((w+H3+Hs)*(d+H3+Hs)) //(pressure at top)
 dRt  = 

   51.428571


--> dRm=(p*w*d)/((w+H3+Hs+(H1/2))*(d+H3+Hs+(H1/2))) //(pressure at middle)
 dRm  = 

   27.692308


--> dRb=(p*w*d)/((w+H3+Hs+H1)*(d+H3+Hs+H1)) //(pressure at bottom)
 dRb  = 

   17.307692


--> dR=(dRt+(4*dRm)+dRb)/6 //(average pressure)
 dR  = 

   29.917582


--> sf=((Cc*H1)/(1+eo))*((log((Ro+dR)/Ro))/2.303) 
 sf  = 

   0.0994376


--> Sf=sf*1000 //(consolidation settlement at middle of the clay layer)
 Sf  = 

   99.437569


--> //results

--> printf('consolidation settlement at middle of the clay layer=%f',Sf) //mm
consolidation settlement at middle of the clay layer=99.437569
