Total Charge

Dear all,

My system have some water molecules (TIP3P model) that totally charge is zero and as well as two other ions that one has -10 and other has +10 (in real units). Totally my system natural. But when I use below commands to show total charge:

variable charge equal charge(all)
variable density equal mass(all)10/(vol6.28)
thermo 1
thermo_style custom step temp press ecoul v_charge v_density vol

I see that total charge is not zero!

Step Temp Press E_coul charge density Volume
30 557.47643 751.68809 42906.03 6.9489969e-12 0.84429376 133357.57
31 566.70991 272.51715 42846.316 6.9489969e-12 0.84429349 133357.62

Please help me, Thanks a lot,
Yasti

Dear all,

My system have some water molecules (TIP3P model) that totally charge is
zero and as well as two other ions that one has -10 and other has +10 (in
real units). Totally my system natural. But when I use below commands to
show total charge:

variable charge equal charge(all)
variable density equal mass(all)*10/(vol*6.28)
thermo 1
thermo_style custom step temp press ecoul v_charge v_density vol

I see that total charge is not zero!

it *is*. you need to learn about floating-point math. how is 7e-12
significantly different from zero???