Urgent help: System has non-zero total charge

How i can solve this issue?
I read in one discussion that we can use -maxwarn option for this issue. but when i used this, it says the command line is not correct.

it is showing the following warning:
WARNING 1 [file topol.top, line 51]:
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.

Fatal error:
Too many warnings (1).
If you are sure all warnings are harmless, use the -maxwarn option.

it showed the note:
System has non-zero total charge: -0.340000
Total charge should normally be an integer. See
Floating point arithmetic — GROMACS webpage https://www.gromacs.org documentation
for discussion on how close it should be to an integer.

Could you send the exact command you used and error you got regarding the command line not being correct? Adding -maxwarn 1 to the command should work if the issue is just ignoring 1 warning.

Alternatively, you could use gmx genion to add ions to neutralize the charge if it’s not necessary to the simulation

I used this command:
gmx grompp -f em.mdp -c solv_ions.gro -p topol.top -o em.tpr

and got the error as;
NOTE 2 [file topol.top, line 51]:
System has non-zero total charge: -0.340000
Total charge should normally be an integer. See
Floating point arithmetic — GROMACS webpage https://www.gromacs.org documentation
for discussion on how close it should be to an integer.

WARNING 1 [file topol.top, line 51]:
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.
There were 2 notes

There was 1 warning


Program: gmx grompp, version 2020.1-Ubuntu-2020.1-1
Source file: src/gromacs/gmxpreprocess/grompp.cpp (line 2353)

Fatal error:
Too many warnings (1).
If you are sure all warnings are harmless, use the -maxwarn option.

For more information and tips for troubleshooting, please check the GROMACS
website at Common Errors — GROMACS webpage https://www.gromacs.org documentation

after the command that i mentioned i just add -maxwarn and press enter
then it says command not found

Did you include the number of warnings to ignore? (-maxwarn 1)

I just used this command and i worked…i was not using 1

But as by using this warning was ignored. Is there any other way to solve the problem ?

Do not override the warning. The fractional charge is unphysical and it means your topology is wrong. If your system is a protein, you likely chose the wrong patches for at least one terminus. Please give us the details of how you generated the topology and what terminus types you used.

actually i am using a aromatase protein (PDB: 3eqm)
this protein has Hem group inside it in addition to ligand.
i want to do the simulation of my compound with the protein but i also wanted that hem group to be present inside the protein

When i generated the topology file for the protein having Hem group
then in addition to posre, topol and processed file i also got two other topolo itp files which named as topol_Other_chain_A2
and topol_Protein_chain_A

this is my topology file :

;
; File ‘topol.top’ was generated
; By user: unknown (1000)
; On host: DESKTOP-3FJM5T1
; At date: Thu Jul 13 00:44:12 2023
;
; This is a standalone topology file
;
; Created by:
; :-) GROMACS - gmx pdb2gmx, 2020.1-Ubuntu-2020.1-1 (-:
;
; Executable: /usr/bin/gmx
; Data prefix: /usr
; Working dir: /mnt/c/users/Qc/Desktop/Heme-MD
; Command line:
; gmx pdb2gmx -f pro.pdb -o pro_processed.gro -ter -ignh -missing
; Force field was read from the standard GROMACS share directory.
;

; Include forcefield parameters
#include “charmm27.ff/forcefield.itp”
#include “lig.itp”

; Include chain topologies
#include “topol_Protein_chain_A.itp”
#include “topol_Other_chain_A2.itp”

; Ligand position restraints
#ifdef POSRES_LIG
#include “posre_lig.itp”
#endif

; Include water topology
#include “charmm27.ff/tip3p.itp”

#ifdef POSRES_WATER
; Position restraint for each water oxygen
[ position_restraints ]
; i funct fcx fcy fcz
1 1 1000 1000 1000
#endif

; Include topology for ions
#include “charmm27.ff/ions.itp”

[ system ]
; Name
Protein in water

[ molecules ]
; Compound #mols
Protein_chain_A 1
Other_chain_A2 1
lig 1
SOL 17628
NA 1

while the information regarding the dihedrals and other stuff are present in the files that i mentioned in previous msg

@jalemkul @Karis

The end of each [moleculetype] in the .itp files will list its net charge if it was produced by pdb2gmx. Check the protein topology and if it has a fractional charge, it is almost certainly because you chose incorrect terminus patching. If it is coming from the ligand (lig.itp), then you need to correctly assign charges.

i checked it…as i told you three files were generated for the protein one was topolo.top and the other two were itp files. the dihedral and bond parameters for heme group and protein were separately given in these two files.
i checked the file with HEME group, it has a charge in fractional value

can you lease check this, i think due to this file i am getting errors.
;
; File ‘topol_Other_chain_A2.itp’ was generated
; By user: unknown (1000)
; On host: DESKTOP-3FJM5T1
; At date: Thu Jul 13 00:44:56 2023
;
; This is a include topology file
;
; Created by:
; :-) GROMACS - gmx pdb2gmx, 2020.1-Ubuntu-2020.1-1 (-:
;
; Executable: /usr/bin/gmx
; Data prefix: /usr
; Working dir: /mnt/c/users/Qc/Desktop/Heme-MD
; Command line:
; gmx pdb2gmx -f pro.pdb -o pro_processed.gro -ter -ignh -missing
; Force field was read from the standard GROMACS share directory.
;

[ moleculetype ]
; Name nrexcl
Other_chain_A2 3

[ atoms ]
; nr type resnr residue atom cgnr charge mass typeB chargeB massB
; residue 600 HEM rtp HEME q -5.3
1 FE 600 HEM FE 1 0.24 55.847
2 NPH 600 HEM NA 2 -0.18 14.007
3 NPH 600 HEM NB 3 -0.18 14.007
4 NPH 600 HEM NC 4 -0.18 14.007
5 NPH 600 HEM ND 5 -0.18 14.007
6 CPA 600 HEM C1A 6 0.12 12.011
7 CPB 600 HEM C2A 7 -0.06 12.011
8 CPB 600 HEM C3A 8 -0.06 12.011
9 CPA 600 HEM C4A 9 0.12 12.011
10 CPA 600 HEM C1B 10 0.12 12.011
11 CPB 600 HEM C2B 11 -0.06 12.011
12 CPB 600 HEM C3B 12 -0.06 12.011
13 CPA 600 HEM C4B 13 0.12 12.011
14 CPA 600 HEM C1C 14 0.12 12.011
15 CPB 600 HEM C2C 15 -0.06 12.011
16 CPB 600 HEM C3C 16 -0.06 12.011
17 CPA 600 HEM C4C 17 0.12 12.011
18 CPA 600 HEM C1D 18 0.12 12.011
19 CPB 600 HEM C2D 19 -0.06 12.011
20 CPB 600 HEM C3D 20 -0.06 12.011
21 CPA 600 HEM C4D 21 0.12 12.011
22 CPM 600 HEM CHA 22 -0.1 12.011
23 CPM 600 HEM CHB 23 -0.1 12.011
24 CPM 600 HEM CHC 24 -0.1 12.011
25 CPM 600 HEM CHD 25 -0.1 12.011
26 CT3 600 HEM CMA 26 -0.27 12.011
27 CT2 600 HEM CAA 27 -0.18 12.011
28 CT2 600 HEM CBA 28 -0.28 12.011
29 CC 600 HEM CGA 29 0.62 12.011
30 OC 600 HEM O1A 30 -0.76 15.999
31 OC 600 HEM O2A 31 -0.76 15.999
32 CT3 600 HEM CMB 32 -0.27 12.011
33 CE1 600 HEM CAB 33 -0.15 12.011
34 CE2 600 HEM CBB 34 -0.42 12.011
35 CT3 600 HEM CMC 35 -0.27 12.011
36 CE1 600 HEM CAC 36 -0.15 12.011
37 CE2 600 HEM CBC 37 -0.42 12.011
38 CT3 600 HEM CMD 38 -0.27 12.011
39 CT2 600 HEM CAD 39 -0.18 12.011
40 CT2 600 HEM CBD 40 -0.28 12.011
41 CC 600 HEM CGD 41 0.62 12.011
42 OC 600 HEM O1D 42 -0.76 15.999
43 OC 600 HEM O2D 43 -0.76 15.999 ; qtot -5.34

When you generated the files with pdb2gmx, was there a point where you were asked to “Select start terminus type” followed by a list of options to choose? If so, which ones did you choose? As mentioned in some of the earlier replies, an incorrect choice is a likely cause of the error. Could you provide the entire output message you got when you ran pdb2gmx?

terminus type means the choosing of NH3+ and COO- ?

after this step i got these files
topol.top (1.1 KB)
the other two files were .itp files i am unable to send that files as this system does not support them.

Yes, you might need to check if a different choice of terminus fixes the issue

Which terminus i can use?
What tried by not using the terminus option but again it showed the same error of non zero charge value…

Polypeptides at neutral pH have NH3+ and COO- termini, so that’s generally what you should choose. As Karis said, providing the complete terminal output from pdb2gmx (including your command, everything copied and pasted) would be extremely informative for us if you’re running into problems at that point.

i used these.
i am facing problem at the point when i run em.mdp file
it says a warning with non zero charge value

i am attaching the topol.top file and other two files which were generated were .itp files… i am copy pasting the file with Heme group here.

;
; File ‘topol_Other_chain_A2.itp’ was generated
; By user: unknown (1000)
; On host: DESKTOP-3FJM5T1
; At date: Fri Jul 14 10:55:39 2023
;
; This is a include topology file
;
; Created by:
; :-) GROMACS - gmx pdb2gmx, 2020.1-Ubuntu-2020.1-1 (-:
;
; Executable: /usr/bin/gmx
; Data prefix: /usr
; Working dir: /mnt/c/Users/Qc/Desktop/Heme-MD
; Command line:
; gmx pdb2gmx -f pro.pdb -o pro_processed.gro -ignh -missing
; Force field was read from the standard GROMACS share directory.
;

[ moleculetype ]
; Name nrexcl
Other_chain_A2 3

[ atoms ]
; nr type resnr residue atom cgnr charge mass typeB chargeB massB
; residue 600 HEM rtp HEME q -5.3
1 FE 600 HEM FE 1 0.24 55.847
2 NPH 600 HEM NA 2 -0.18 14.007
3 NPH 600 HEM NB 3 -0.18 14.007
4 NPH 600 HEM NC 4 -0.18 14.007
5 NPH 600 HEM ND 5 -0.18 14.007
6 CPA 600 HEM C1A 6 0.12 12.011
7 CPB 600 HEM C2A 7 -0.06 12.011
8 CPB 600 HEM C3A 8 -0.06 12.011
9 CPA 600 HEM C4A 9 0.12 12.011
10 CPA 600 HEM C1B 10 0.12 12.011
11 CPB 600 HEM C2B 11 -0.06 12.011
12 CPB 600 HEM C3B 12 -0.06 12.011
13 CPA 600 HEM C4B 13 0.12 12.011
14 CPA 600 HEM C1C 14 0.12 12.011
15 CPB 600 HEM C2C 15 -0.06 12.011
16 CPB 600 HEM C3C 16 -0.06 12.011
17 CPA 600 HEM C4C 17 0.12 12.011
18 CPA 600 HEM C1D 18 0.12 12.011
19 CPB 600 HEM C2D 19 -0.06 12.011
20 CPB 600 HEM C3D 20 -0.06 12.011
21 CPA 600 HEM C4D 21 0.12 12.011
22 CPM 600 HEM CHA 22 -0.1 12.011
23 CPM 600 HEM CHB 23 -0.1 12.011
24 CPM 600 HEM CHC 24 -0.1 12.011
25 CPM 600 HEM CHD 25 -0.1 12.011
26 CT3 600 HEM CMA 26 -0.27 12.011
27 CT2 600 HEM CAA 27 -0.18 12.011
28 CT2 600 HEM CBA 28 -0.28 12.011
29 CC 600 HEM CGA 29 0.62 12.011
30 OC 600 HEM O1A 30 -0.76 15.999
31 OC 600 HEM O2A 31 -0.76 15.999
32 CT3 600 HEM CMB 32 -0.27 12.011
33 CE1 600 HEM CAB 33 -0.15 12.011
34 CE2 600 HEM CBB 34 -0.42 12.011
35 CT3 600 HEM CMC 35 -0.27 12.011
36 CE1 600 HEM CAC 36 -0.15 12.011
37 CE2 600 HEM CBC 37 -0.42 12.011
38 CT3 600 HEM CMD 38 -0.27 12.011
39 CT2 600 HEM CAD 39 -0.18 12.011
40 CT2 600 HEM CBD 40 -0.28 12.011
41 CC 600 HEM CGD 41 0.62 12.011
42 OC 600 HEM O1D 42 -0.76 15.999
43 OC 600 HEM O2D 43 -0.76 15.999 ; qtot -5.34

[ bonds ]
; ai aj funct c0 c1 c2 c3
1 2 1
1 3 1
1 4 1
1 5 1
2 6 1
2 9 1
3 10 1
3 13 1
4 14 1
4 17 1
5 18 1
5 21 1
6 7 1
6 22 1
7 8 1
7 27 1
8 9 1
8 26 1
9 23 1
10 11 1
10 23 1
11 12 1
11 32 1
12 13 1
12 33 1
13 24 1
14 15 1
14 24 1
15 16 1
15 35 1
16 17 1
16 36 1
17 25 1
18 19 1
18 25 1
19 20 1
19 38 1
20 21 1
20 39 1
21 22 1
27 28 1
28 29 1
29 30 1
29 31 1
33 34 1
36 37 1
39 40 1
40 41 1
41 42 1
41 43 1

[ pairs ]
; ai aj funct c0 c1 c2 c3
1 7 1
1 8 1
1 11 1
1 12 1
1 15 1
1 16 1
1 19 1
1 20 1
1 22 1
1 23 1
1 24 1
1 25 1
2 10 1
2 13 1
2 14 1
2 17 1
2 18 1
2 21 1
2 26 1
2 27 1
3 6 1
3 9 1
3 14 1
3 17 1
3 18 1
3 21 1
3 32 1
3 33 1
4 6 1
4 9 1
4 10 1
4 13 1
4 18 1
4 21 1
4 35 1
4 36 1
5 6 1
5 9 1
5 10 1
5 13 1
5 14 1
5 17 1
5 38 1
5 39 1
6 20 1
6 23 1
6 26 1
6 28 1
7 21 1
7 23 1
7 29 1
8 10 1
8 22 1
8 28 1
9 11 1
9 22 1
9 27 1
10 24 1
10 33 1
11 24 1
11 34 1
12 14 1
12 23 1
13 15 1
13 23 1
13 32 1
13 34 1
14 25 1
14 36 1
15 25 1
15 37 1
16 18 1
16 24 1
17 19 1
17 24 1
17 35 1
17 37 1
18 22 1
18 39 1
19 22 1
19 40 1
20 25 1
20 41 1
21 25 1
21 38 1
21 40 1
22 27 1
22 39 1
23 26 1
23 32 1
24 33 1
24 35 1
25 36 1
25 38 1
26 27 1
27 30 1
27 31 1
32 33 1
35 36 1
38 39 1
39 42 1
39 43 1

[ angles ]
; ai aj ak funct c0 c1 c2 c3
2 1 3 5
2 1 4 5 180.0 0.0 0.0 0.0
2 1 5 5
3 1 4 5
3 1 5 5 180.0 0.0 0.0 0.0
4 1 5 5
1 2 6 5
1 2 9 5
6 2 9 5
1 3 10 5
1 3 13 5
10 3 13 5
1 4 14 5
1 4 17 5
14 4 17 5
1 5 18 5
1 5 21 5
18 5 21 5
2 6 7 5
2 6 22 5
7 6 22 5
6 7 8 5
6 7 27 5
8 7 27 5
7 8 9 5
7 8 26 5
9 8 26 5
2 9 8 5
2 9 23 5
8 9 23 5
3 10 11 5
3 10 23 5
11 10 23 5
10 11 12 5
10 11 32 5
12 11 32 5
11 12 13 5
11 12 33 5
13 12 33 5
3 13 12 5
3 13 24 5
12 13 24 5
4 14 15 5
4 14 24 5
15 14 24 5
14 15 16 5
14 15 35 5
16 15 35 5
15 16 17 5
15 16 36 5
17 16 36 5
4 17 16 5
4 17 25 5
16 17 25 5
5 18 19 5
5 18 25 5
19 18 25 5
18 19 20 5
18 19 38 5
20 19 38 5
19 20 21 5
19 20 39 5
21 20 39 5
5 21 20 5
5 21 22 5
20 21 22 5
6 22 21 5
9 23 10 5
13 24 14 5
17 25 18 5
7 27 28 5
27 28 29 5
28 29 30 5
28 29 31 5
30 29 31 5
12 33 34 5
16 36 37 5
20 39 40 5
39 40 41 5
40 41 42 5
40 41 43 5
42 41 43 5

[ dihedrals ]
; ai aj ak al funct c0 c1 c2 c3 c4 c5
3 1 2 6 9
3 1 2 9 9
4 1 2 6 9
4 1 2 9 9
5 1 2 6 9
5 1 2 9 9
2 1 3 10 9
2 1 3 13 9
4 1 3 10 9
4 1 3 13 9
5 1 3 10 9
5 1 3 13 9
2 1 4 14 9
2 1 4 17 9
3 1 4 14 9
3 1 4 17 9
5 1 4 14 9
5 1 4 17 9
2 1 5 18 9
2 1 5 21 9
3 1 5 18 9
3 1 5 21 9
4 1 5 18 9
4 1 5 21 9
1 2 6 7 9
1 2 6 22 9
9 2 6 7 9
9 2 6 22 9
1 2 9 8 9
1 2 9 23 9
6 2 9 8 9
6 2 9 23 9
1 3 10 11 9
1 3 10 23 9
13 3 10 11 9
13 3 10 23 9
1 3 13 12 9
1 3 13 24 9
10 3 13 12 9
10 3 13 24 9
1 4 14 15 9
1 4 14 24 9
17 4 14 15 9
17 4 14 24 9
1 4 17 16 9
1 4 17 25 9
14 4 17 16 9
14 4 17 25 9
1 5 18 19 9
1 5 18 25 9
21 5 18 19 9
21 5 18 25 9
1 5 21 20 9
1 5 21 22 9
18 5 21 20 9
18 5 21 22 9
2 6 7 8 9
2 6 7 27 9
22 6 7 8 9
22 6 7 27 9
2 6 22 21 9
7 6 22 21 9
6 7 8 9 9
6 7 8 26 9
27 7 8 9 9
27 7 8 26 9
6 7 27 28 9
8 7 27 28 9
7 8 9 2 9
7 8 9 23 9
26 8 9 2 9
26 8 9 23 9
2 9 23 10 9
8 9 23 10 9
3 10 11 12 9
3 10 11 32 9
23 10 11 12 9
23 10 11 32 9
3 10 23 9 9
11 10 23 9 9
10 11 12 13 9
10 11 12 33 9
32 11 12 13 9
32 11 12 33 9
11 12 13 3 9
11 12 13 24 9
33 12 13 3 9
33 12 13 24 9
11 12 33 34 9
13 12 33 34 9
3 13 24 14 9
12 13 24 14 9
4 14 15 16 9
4 14 15 35 9
24 14 15 16 9
24 14 15 35 9
4 14 24 13 9
15 14 24 13 9
14 15 16 17 9
14 15 16 36 9
35 15 16 17 9
35 15 16 36 9
15 16 17 4 9
15 16 17 25 9
36 16 17 4 9
36 16 17 25 9
15 16 36 37 9
17 16 36 37 9
4 17 25 18 9
16 17 25 18 9
5 18 19 20 9
5 18 19 38 9
25 18 19 20 9
25 18 19 38 9
5 18 25 17 9
19 18 25 17 9
18 19 20 21 9
18 19 20 39 9
38 19 20 21 9
38 19 20 39 9
19 20 21 5 9
19 20 21 22 9
39 20 21 5 9
39 20 21 22 9
19 20 39 40 9
21 20 39 40 9
5 21 22 6 9
20 21 22 6 9
7 27 28 29 9
27 28 29 30 9
27 28 29 31 9
20 39 40 41 9
39 40 41 42 9
39 40 41 43 9

[ dihedrals ]
; ai aj ak al funct c0 c1 c2 c3
1 9 6 2 2
1 13 10 3 2
1 17 14 4 2
1 21 18 5 2
2 22 7 6 2
2 9 8 7 2
2 6 7 8 2
2 23 8 9 2
2 9 23 10 2
2 6 22 21 2
3 10 23 9 2
3 23 11 10 2
3 13 12 11 2
3 10 11 12 2
3 24 12 13 2
3 13 24 14 2
4 14 24 13 2
4 24 15 14 2
4 17 16 15 2
4 14 15 16 2
4 25 16 17 2
4 17 25 18 2
5 21 22 6 2
5 18 25 17 2
5 25 19 18 2
5 21 20 19 2
5 18 19 20 2
5 22 20 21 2
6 2 9 8 2
7 6 2 9 2
7 6 8 27 2
8 7 9 26 2
10 3 13 12 2
11 10 3 13 2
11 10 12 32 2
12 11 13 33 2
14 4 17 16 2
15 14 4 17 2
15 14 16 35 2
16 15 17 36 2
18 5 21 20 2
19 18 5 21 2
19 18 20 38 2
20 19 21 39 2
29 28 31 30 2
41 40 43 42 2

; Include Position restraint file
#ifdef POSRES
#include “posre_Other_chain_A2.itp”
topol.top (1.1 KB)

Terminal output as in the messages you got when you entered the commands (so the warnings, error messages, notes, etc.), just copy paste everything that shows up when you ran pdb2gmx including the exact command you used