# [gmx-users] Query about a simple MD with constant electric field

Thu Mar 10 11:33:14 CET 2016

```Dear Prof. Spoel

1) No, I did not get any warning about PME and charge system, just a
note

NOTE 4 [file topol.top, line 23]:
System has non-zero total charge: 1.000000
Total charge should normally be an integer. See
http://www.gromacs.org/Documentation/Floating_Point_Arithmetic
for discussion on how close it should be to an integer

2) I tried the simulation with a plain cut-off scheme and no PME and but
still my positive ion moves with constant velocity.
At the link below you can see my files, the coord.xvg and the veloc.xvg
for the coordinates and the velocity of my ion

https://goo.gl/Q0pyR9

3) Following your suggestions, I have also tried an MD using PME and two
ions of opposite charge. The two ions were placed at about 2.5 nm
distance, interacting only through electrostatic and with a cut-off of
0.9 nm. Interestingly, here the behavior seems correct with the velocity
that grows linearly with time (see velocBr.xvg and velocNa.xvg attached

https://goo.gl/TDM0lZ

Thus  my new  question....Does the electric field in Gromacs works only
with PME and neutral system?

Thank you very very much for your help
Ivan

On 2016-03-09 20:10, David van der Spoel wrote:
> On 09/03/16 11:48, Ivan Gladich wrote:
>> Dear Gromacs users
>>
>> I am doing a very simple MD with a constant electric field of 1 V/nm
>> along the positive z-direction in a system containing only one Na+
>> ion,
>> starting from rest.
>> The ion is not coupled to the thermostat and it is placed in a box of
>> 4
>> nm* 4nm * 16 nm, in the X,Y,and Z direction respectively.
>>
>>   I would expect my ion accelerating along the positive Z-direction
>> with
>> constant acceleration.
>> However my ion  starts to move in the positive  Z-direction but with
>> constant velocity for all my 1 ns MD. Do I do something really wrong?
>>
> Yes :).
> I guess you got at least a warning from grompp, right? About using a
> charged system with PME. If you have a net charge in the system PME
> compensates for it by applying a homogeneous charge distribution with
> the opposite sign. This can give interesting results.
> You could try using a cut-off instead if you just have one particle.
> Or use an ion pair.
>
>> I am using gromacs 5.1.1 in double precision
>>
>> Thanks for any possible help
>> Below my inputs
>> Ivan
>>
>> ###########
>> conf.gro
>> ###########
>>
>> Gyas ROwers Mature At Cryogenic Speed
>>   1
>>   2183Na      Na 6545   3.014   0.540   8.909
>>     4.00000   4.00000  16.00000
>>
>> ##########
>> topol.top
>> #########
>>
>> [ defaults ]
>> ; nbfunc        comb-rule       gen-pairs       fudgeLJ fudgeQQ
>> 1               2               yes             0.5     0.8333
>>
>> [ atomtypes ]
>> ;name  at.num   mass       charge   ptype   sigma   epsilon
>> Na        11      79.90    1.0000  A    0.385       0.0022
>>
>> [ moleculetype ]
>> ; molname       nrexcl
>> Na              1
>>
>> [ atoms ]
>> ; id    at type         res nr  residu name     at name  cg nr  charge
>> 1       Na              1       Na              Na       1
>> 1.00000
>>
>> [ system ]
>>   THE-BEST
>>
>> [ molecules ]
>> ; Compound        nmols
>>   Na              1
>>
>>
>> #########
>> grompp.mdp
>> #########
>>
>> title       = Na+Electric
>>
>> ; Run parameters
>> integrator  = md        ; leap-frog integrator
>> nsteps      = 1000000   ;  = 1000ps
>> dt          = 0.001     ; 1 fs
>>
>> ; Output control
>> nstxout     = 0       ; save coordinates every 1.0 ps
>> nstvout     = 1000       ; save velocities every 1.0 ps
>> nstenergy   = 5000    ; save energies every 1 ps
>> nstlog      = 5000    ; update log file every 1 ps
>> nstxtcout   = 1000    ; xtc compressed trajectory output every 1 ps
>>
>> ; Neighborsearching
>> cutoff-scheme   = group ;Verlet
>> ns_type         = grid      ; search neighboring grid cells
>> nstlist         = 1        ; 20 fs, largely irrelevant with Verlet
>> rlist           = 0.9
>> rcoulomb        = 0.9       ; short-range electrostatic cutoff (in nm)
>> rvdw            = 0.9       ; short-range van der Waals cutoff (in nm)
>>
>> ; Electrostatics
>> coulombtype     = PME       ; Particle Mesh Ewald for long-range
>> electrostatics
>> pme_order       = 4         ; cubic interpolation
>> fourierspacing  = 0.16      ; grid spacing for FFT
>>
>> ; Temperature coupling
>> tcoupl      = no ;
>>
>> ; Pressure coupling
>> pcoupl      = no;
>>
>> ; Periodic boundary conditions
>> pbc         = xyz       ; 3-D PBC
>>
>> ; Dispersion correction
>> DispCorr    = no ;
>>
>> ; Velocity generation
>> gen_vel     = no
>>
>> ;Electric
>>
>> E-x = 0 0 0
>> E-y = 0 0 0
>> E-z = 1 1 0 : 1 V nm-1
>>
>
>
> --
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
> spoel at xray.bmc.uu.se    http://folding.bmc.uu.se

```