Spring and setforce

I need to fix a group of atoms so that they don’t move during the simulation. Is spring/self or setforce 0 0 0 a better option for doing this. In spring I understand that we are giving an extra energy (in the order of kx^2) to the system to restrict the motion. How do we compensate for this additional energy.

I need to fix a group of atoms so that they don't move during the
simulation. Is spring/self or setforce 0 0 0 a better option for doing this.
In spring I understand that we are giving an extra energy (in the order of
kx^2) to the system to restrict the motion. How do we compensate for this
additional energy.

both options have their place. using setforce (in combination with
initializing velocities to zero) renders the atoms completely immobile
(as if they were kept at 0K). with fix spring/self atoms are allow to
move around their respective tether points and thus don't move *on
average*.

why do you think that you need to "compensate" for the restraints?

which option to choose, usually depends on the nature of the specific
system and your personal preference.

axel.