# Center of mass motion issue

**URL:** <https://gromacs.bioexcel.eu/t/center-of-mass-motion-issue/9219>\
**Category:** User discussions\
**Created:** [May 25, 2024, 7:15am UTC](https://gromacs.bioexcel.eu/t/center-of-mass-motion-issue/9219 "2024-05-25T07:15:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rana-1](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@Rana-1](https://gromacs.bioexcel.eu/u/Rana-1)\
**Post date:** [May 25, 2024, 7:15am UTC](https://gromacs.bioexcel.eu/t/center-of-mass-motion-issue/9219/1 "2024-05-25T07:15:17Z")

</div>

GROMACS version: 2020.4  
GROMACS modification: Yes/No  
Here post your question

Dear users  
I ran a 10 ns MD for a DNA molecule.  
the .mdp file I used is attached. After the MD is complete, I used the commands below to prepare my .xtc and .gro files I need for trajectory analysis.

gmx trjconv -s “A1\_A2\_pr.tpr” -f “A1\_A2\_pr.xtc” -o “A1\_A2\_pr\_PBC.xtc” -pbc mol -center  
gmx trjconv -s “A1\_A2\_pr.tpr” -f “A1\_A2\_pr.xtc” -o “A1\_A2\_pr\_PBC.gro” -pbc mol -center -dump 1

I noticed that the molecule moves. It translates and rotates. My understanding that rotation is expected but translation is not because the mdout.mdp says that center of mass motion is removed every 100 steps.

**md\_pr.mdp**  
title = Simulations on Visual Dynamics

; Run parameters  
integrator = md ; leap-frog integrator  
nsteps = 5000000 ; 2 \* 5000000 = 10000 ps (10 ns)  
dt = 0.002 ; 2 fs

; Output control  
nstxout = 0 ; save coordinates every 10.0 ps  
nstvout = 0 ; save velocities every 10.0 ps  
nstenergy = 5000 ; save energies every 10.0 ps  
nstlog = 5000 ; update log file every 10.0 ps  
nstxout-compressed = 5000 ; save compressed coordinates every 10.0 ps  
; nstxout-compressed replaces nstxtcout  
compressed-x-grps = System ; replaces xtc-grps

; Bond parameters  
continuation = yes ; Restarting after NPT  
constraint\_algorithm = lincs ; holonomic constraints  
constraints = h-bonds ; all bonds (even heavy atom-H bonds) constrained  
lincs\_iter = 1 ; accuracy of LINCS  
lincs\_order = 4 ; also related to accuracy

; Nonbonded settings  
cutoff-scheme = Verlet ; Buffered neighbor searching  
ns\_type = grid ; search neighboring grid cells  
nstlist = 10 ; 20 fs, largely irrelevant with Verlet  
rlist = 1.2  
vdwtype = Cut-off  
vdw-modifier = Force-switch  
rvdw\_switch = 1.0  
rvdw = 1.2 ; short-range van der Waals cutoff (in nm)  
rcoulomb = 1.2 ; short-range electrostatic cutoff (in nm)  
DispCorr = no ; account for cut-off vdW scheme

; Electrostatics  
coulombtype = PME ; Particle Mesh Ewald for long-range electrostatics  
pme\_order = 4 ; cubic interpolation  
fourierspacing = 0.16 ; grid spacing for FFT

; Temperature coupling is on  
tcoupl = V-rescale ; modified Berendsen thermostat  
tc-grps = DNA Water\_and\_ions ; two coupling groups - more accurate  
tau\_t = 0.1 0.1 ; time constant, in ps  
ref\_t = 300 300 ; reference temperature, one for each group, in K

; Pressure coupling is on  
pcoupl = Parrinello-Rahman ; Pressure coupling on in NPT  
pcoupltype = isotropic ; uniform scaling of box vectors  
tau\_p = 2.0 ; time constant, in ps  
ref\_p = 1.0 ; reference pressure, in bar  
compressibility = 4.5e-5 ; isothermal compressibility of water, bar^-1

; Periodic boundary conditions  
pbc = xyz ; 3-D PBC

; Velocity generation  
gen\_vel = no ; Velocity generation is off

**mdout.mdp**  
; mode for center of mass motion removal  
comm-mode = Linear  
; number of steps for center of mass motion removal  
nstcomm = 100  
; group(s) for center of mass motion removal  
comm-grps =

 ![Screenshot 2024-05-25 at 08.12.21](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/5/5cbfca8ad95005e40da45811edd37d0f201ec9fe.png)

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [May 25, 2024, 12:32pm UTC](https://gromacs.bioexcel.eu/t/center-of-mass-motion-issue/9219/2 "2024-05-25T12:32:55Z")

</div>

Dear @Rana-1 ,

The two things are different. The COM motion removal should be a calculation of the velocity of the COM of the whole box, and then that velocity is subtracted to all the atoms in the box, that is, you are setting to zero the velocity of the COM of the box. If I remember correctly, this makes sure that the box doesn’t accumulate kinetic energy over time due to numerical integration errors etc, which back in the day in the first MD works gave origin to the so called [flying ice cube effect](https://en.wikipedia.org/wiki/Flying_ice_cube), where the rescaling of velocities to thermostat the systems led to frozen atomic configurations and box huge linear momenta (a flying ice cube!).

The removal of the COM is, very roughly, something to prevent an artifact. However, the ability of the system to diffuse around the box is something else, which is related to the nature of what you simulate. Here you have DNA in water at 300 K and I would say there is no reason to expect it to not diffuse around.
