--> //initializations

--> Vh=400 //ml (volume of hole)
 Vh  = 

   400.


--> Ms=9 //N (excavated soil weight)
 Ms  = 

   9.


--> Md=7.8 //N (oven dry)
 Md  = 

   7.8


--> M=4 //N (poured in vessel)
 M  = 

   4.


--> V=270 //ml (volime in loose state)
 V  = 

   270.


--> Vt=200 //ml (tamped and vibrated)
 Vt  = 

   200.


--> //calculations

--> w=(Ms-Md)/Md //(water content)
 w  = 

   0.1538462


--> Yd=Md/Vh //(dry unit weight)
 Yd  = 

   0.0195


--> Ydmin=M/V //(min dry unit weight)
 Ydmin  = 

   0.0148148


--> Ydmax=M/Vt //(max dry unit weight)
 Ydmax  = 

   0.02


--> Dr=(Ydmax/Yd)*((Yd-Ydmin)/(Ydmax-Ydmin))*100 //(relative density)
 Dr  = 

   92.673993


--> //results

--> printf('relative density=%f',Dr) //%
relative density=92.673993