From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sun Aug 06 2017 - 22:26:32 CDT

On Sun, Aug 6, 2017 at 10:30 PM, <t.shivam_at_iitg.ernet.in> wrote:

>
>
> > On Sun, Aug 6, 2017 at 10:51 AM, <t.shivam_at_iitg.ernet.in> wrote:
> >
> >> Dear vmd users,
> >>
> >> I have a protein solvated in a water box whose net charge is
> >> 7.999999954365194, so when i am using autoionize to neutralize my system
> >> it is showing a charge of -4.563480615615845e-8, i also tried to add 8
> >> chlorine ions instead of going for neutralize option (anyway its more or
> >> less the same thing), so please kindly help me with this problem.
> >>
> >
> > ​there is no problem with autoionize. the problem is between your chair
> > and
> > your computer.​ you are doing floating point math here​​, so -4.5e-8
> > is
> > essentially zero and most certainly zero when rounded to the precision at
> > which partial charges are specified in the CHARMM force field.
> >
> > axel.
>
>
> this might sound funny to you but previously i have solvated my protein in
> a smaller box but the charge of the protein is same (7.999999954365194)so
> at that when i neutralized my system, vmd was showing a perfect zero(0.0),
>

​this is not funny. it only shows, that ​you seem unaware of the
idiosyncrasies of doing math with floating point numbers.

> so i saved the files of the ionized system, but after that i also created
> a bigger box, and now when i am neutralizing it, it is showing
> -4.563480615615845e-8, and the strangest part is that when i am checking
> my previous system (smaller box showing charge 0.0) it is also showing
> -4.563480615615845e-8,why is that happening?i agree that the value
> -4.563480615615845e-8 is almost zero.
>

​this is happening, because you are doing floating point math (and are
outputting results with a precision that exceeds the precision of storage).
VMD stores charges as float, and quite a few numbers cannot be represented
exactly with floating point representations.​

i suggest you study the following two blog posts:
http://blog.reverberate.org/2014/09/what-every-computer-programmer-should.html
http://blog.reverberate.org/2016/02/06/floating-point-demystified-part2.html

p
​lease keep in mind, the origin of the non-exactly-zero is the summing of
the partial charges which results in not-exactly-eight. just what do you
get, when you subtract 8 from 7.999999954365194 ?? there is no mystery at
all here.

axel.

> regards
> shivam
> >
> >
> >>
> >> regards
> >> shivam
> >>
> >>
> >
> >
> > --
> > Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
> > College of Science & Technology, Temple University, Philadelphia PA, USA
> > International Centre for Theoretical Physics, Trieste. Italy.
> >
>
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.