--> //initializations

--> n=0.4 //(porosity)
 n  = 

   0.4


--> G=2.65 //(specific gravity)
 G  = 

   2.65


--> F=2.50 //(factor of safety)
 F  = 

   2.5


--> h1=1.50 //m (thickness of layer)
 h1  = 

   1.5


--> h2=1.95 //m (seepage head)
 h2  = 

   1.95


--> Dw=1.0 //gm/ml (density of water)
 Dw  = 

   1.


--> g=9.81
 g  = 

   9.81


--> //calculations

--> e=n/(1-n) // (void ratio)
 e  = 

   0.6666667


--> Cg=(G-1)/(1+e) // (critical gradient)
 Cg  = 

   0.99


--> Ds=((G+e)/(1+e))*Dw //g/ml (saturated density)
 Ds  = 

   1.99


--> DS=Ds*g //KN/m^3 (saturated density)
 DS  = 

   19.5219


--> x=((F*g*h2)/(DS-g))-h1 // (depth of coarse sand)
 x  = 

   3.4242424


--> //results

--> printf('depth of coarse sand=%f',x) //m
depth of coarse sand=3.424242
