Simulation of 1D self gravitating object