Fix restrain: Change in equilibrium bond distance

Hello all,

I am using fix restrain to connect 2 atoms. I change the distance between them using equilibrium bond distances (r0start and r0stop). I want to access the force (and its direction) that the restrain generates but the fix only provides the potential energy of the restrain. The magnitude of the force can be extracted from the potential energy.

To determine the direction of the force from the potential energy, I would require one more known quantity: the equilibrium bond distance at each time step. I wonder if there is any formula that describes the change in equilibrium bond distances at each time step. Or any compute that would work on the fix restrain to give the force on it?

Thank you

r_0 is a linear interpolation from r0start to r0stop. I.e.:
r_0 = r_{0,\mathrm{start}} + i_\mathrm{step} \frac{r_{0,\mathrm{stop}}-r_{0,\mathrm{start}}}{\mathrm N_{step}}