shake method for two groups of atoms


I want to use the fix shake method to constraint two groups of atoms, aiming to calculate the PMF with constraint forces method.(The distance between the centers of mass of two groups of atoms can be constrained and the constraint force monitored.)

Did anyone try the above method beforce with LAMMPS? How Can I modify the fix shake command?

Thanks in advance.

I think you want one of the fix spring commands, not SHAKE.