--> //initialisations

--> Dd=1.816//gm/ml (dry density)
 Dd  = 

   1.816


--> Mmin=410//gm (min mass of soil)
 Mmin  = 

   410.


--> Mmax=410//gm (max mass of soil)
 Mmax  = 

   410.


--> Vm1=290//ml (volume on loose state)
 Vm1  = 

   290.


--> Vm2=215//ml (volume on compact state)
 Vm2  = 

   215.


--> //calculations

--> Dmin=Mmin/Vm1 //(min density)
 Dmin  = 

   1.4137931


--> Dmax=Mmax/Vm2 //(max density)
 Dmax  = 

   1.9069767


--> Dr=(Dmax/Dd)*((Dd-Dmin)/(Dmax-Dmin))*100 //(relative density)
 Dr  = 

   85.638767


--> //result

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