Particle displacement changes over time

image
Hello everyone, if I want to obtain the displacement of each particle at each time step, how should I proceed? As shown in the following figure