# Grompp complains of net charge, but itps add up to zero

**URL:** https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561
**Category:** User discussions
**Created:** [July 23, 2020, 5:21pm UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561 "2020-07-23T17:21:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jdandrade](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdandrade](https://gromacs.bioexcel.eu/u/jdandrade)
#### Post date: [July 23, 2020, 5:21pm UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/1 "2020-07-23T17:21:24Z")

</div>

GROMACS version: reproduced on 2018.8, 2019.6, 2020.1  
GROMACS modification: No

Hi all.

We are having a strange issue with one specific system model I’m trying to simulate.

It is composed only by 1,000 cations (individual charges of +0.790566) plus 1,000 anions (individual charges of -0.790566), all verified multiple times already.

In all three versions of gromacs we tested, the gmx grompp complains as:

###########################################  
NOTE 1 [file 1000.HMIm.BF4.3.top, line 24]:  
System has non-zero total charge: -0.000149  
Total charge should normally be an integer. See  
[http://www.gromacs.org/Documentation/Floating\_Point\_Arithmetic](http://www.gromacs.org/Documentation/Floating_Point_Arithmetic)  
for discussion on how close it should be to an integer.

WARNING 1 [file 1000.HMIm.BF4.3.top, line 24]:  
You are using Ewald electrostatics in a system with net charge. This can  
lead to severe artifacts, such as ions moving into regions with low  
dielectric, due to the uniform background charge. We suggest to  
neutralize your system with counter ions, possibly in combination with a  
physiological salt concentration.  
###########################################

Two facts that are extremely odd are that a thousand equivalent molecules with any residual charge error cannot yield a total excess charge of -0.000149, and also that similar models of the same chemical system but with different total charges for cations and anions (including non-integer ones) add properly to zero on gmx grompp.

We also don’t observe any issues with other (smaller) chemical systems being modeled with either integer or non-integer ions total charges.

I just tried to upload the topologies, however it doesn’t allow itp files, and also it complains that I’m a “new user”. I will paste them as a reply just below here.

Thanks a lot for any help!

---

<div class="post-metadata">

### Author: ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)
#### Post date: [July 30, 2020, 2:52am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/2 "2020-07-30T02:52:06Z")

</div>

By any chance did you use MS Excel for summing and balancing charge? I am asking, as minus sign from Excel not recognized as ACSII compatible char.

---

<div class="post-metadata">

### Author: ![jdandrade](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdandrade](https://gromacs.bioexcel.eu/u/jdandrade)
#### Post date: [July 30, 2020, 3:17am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/3 "2020-07-30T03:17:56Z")

</div>

Hi Marsul.

I actually summed them over by hand, rewrote the charge parts of the itp files also by hand, and imported that section into libreoffice calc: In all scenarios I got the same result for the summed charges and for the gmx grompp run.

The charges are reproduced below. Unfortunately there are two threads on this issue ([Gmx grompp complains about net charge but itps add up to zero](https://gromacs.bioexcel.eu/t/gmx-grompp-complains-about-net-charge-but-itps-add-up-to-zero/576)) because “askimet” didn’t like something and flagged it for verification (my bad, sorry for that).

######Atomic Charges#######  
##Anion##  
[atoms]  
1 B 1 ANI B 1 1.010410 10.811  
2 F 1 ANI F1 1 -0.450244 18.9984  
3 F 1 ANI F2 1 -0.450244 18.9984  
4 F 1 ANI F3 1 -0.450244 18.9984  
5 F 1 ANI F4 1 -0.450244 18.9984  
##Cation##  
[atoms]  
1 NA 1 EMI N1 1 0.223701 14.0067  
2 CR 1 EMI C2 1 -0.238364 12.0116  
3 NA 1 EMI N3 1 0.211230 14.0067  
4 CW 1 EMI C4 1 -0.141250 12.0116  
5 CW 1 EMI C5 1 -0.298724 12.0116  
6 H5 1 EMI H2 1 0.275012 1.0079  
7 H4 1 EMI H4 1 0.215820 1.0079  
8 H4 1 EMI H5 1 0.233184 1.0079  
9 CT 1 EMI C1’ 1 -0.340395 12.0116  
10 H1 1 EMI H1’ 1 0.158733 1.0079  
11 H1 1 EMI H1’ 1 0.158733 1.0079  
12 H1 1 EMI H1’ 1 0.158733 1.0079  
13 CT 1 EMI C1" 1 -0.211306 12.0116  
14 H1 1 EMI H1" 1 0.102780 1.0079  
15 H1 1 EMI H1" 1 0.102780 1.0079  
16 CT 1 EMI C2" 1 0.226280 12.0116  
17 HC 1 EMI H2" 1 -0.006821 1.0079  
18 HC 1 EMI H2" 1 -0.006821 1.0079  
19 CT 1 EMI C3" 1 -0.126251 12.0116  
20 HC 1 EMI H3" 1 0.026788 1.0079  
21 HC 1 EMI H3" 1 0.026788 1.0079  
22 CT 1 EMI C4" 1 -0.017332 12.0116  
23 HC 1 EMI H4" 1 0.001619 1.0079  
24 HC 1 EMI H4" 1 0.001619 1.0079  
25 CT 1 EMI C5" 1 0.277371 12.0116  
26 HC 1 EMI H5" 1 -0.052536 1.0079  
27 HC 1 EMI H5" 1 -0.052536 1.0079  
28 CT 1 EMI C6" 1 -0.314907 12.0116  
29 HC 1 EMI H6" 1 0.065546 1.0079  
30 HC 1 EMI H6" 1 0.065546 1.0079  
31 HC 1 EMI H6" 1 0.065546 1.0079  
#########

---

<div class="post-metadata">

### Author: ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)
#### Post date: [July 30, 2020, 3:35am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/4 "2020-07-30T03:35:41Z")

</div>

Well, I think the root of problem is libreoffice calc, it uses some markup annotation to show letter. Best way to do this thing, is to use plain text file. Typically, common practice would be using vim/emacs as editor and awk as column/row wise operation. If you upload your files in cloud like google drive/dropbox providing files to invoke grommp, then it will easier to comment on.

---

<div class="post-metadata">

### Author: ![jdandrade](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdandrade](https://gromacs.bioexcel.eu/u/jdandrade)
#### Post date: [July 30, 2020, 3:42am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/5 "2020-07-30T03:42:37Z")

</div>

Masrul, I think you misunderstood: we wrote the file, by hand, in ascii format. First on kate, second time using vi. We imported those files data to libreoffice calc in order to check them, not the other way around. :)

---

<div class="post-metadata">

### Author: ![jdandrade](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdandrade](https://gromacs.bioexcel.eu/u/jdandrade)
#### Post date: [July 30, 2020, 4:25am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/7 "2020-07-30T04:25:16Z")

</div>

Yes, some of our atoms have single and some double quotation marks. It never yielded any trouble, although: We literally have 3 other charge sets for the same molecule with the same atom naming which all runs with no errors at all. :)

---

<div class="post-metadata">

### Author: ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)
#### Post date: [July 30, 2020, 10:15am UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/8 "2020-07-30T10:15:30Z")

</div>

There is nothing wrong with this system. The sheer magnitude of charged species, coupled with 5 decimal places in the charges, leads to rounding issues that are substantially larger than normal.

---

<div class="post-metadata">

### Author: ![jdandrade](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@jdandrade](https://gromacs.bioexcel.eu/u/jdandrade)
#### Post date: [July 30, 2020, 11:14pm UTC](https://gromacs.bioexcel.eu/t/grompp-complains-of-net-charge-but-itps-add-up-to-zero/561/9 "2020-07-30T23:14:48Z")

</div>

Thanks, jalemkul. We tried today the testing suggestion from user Dr\_DBW on the other topic ([Gmx grompp complains about net charge but itps add up to zero](https://gromacs.bioexcel.eu/t/gmx-grompp-complains-about-net-charge-but-itps-add-up-to-zero/576)) and it proves that this is indeed the cause for the “oddity” observed.
