From: Axel Kohlmeyer (
Date: Tue Jul 06 2010 - 16:01:03 CDT

On Tue, Jul 6, 2010 at 3:36 PM, Parisa Akhski
<> wrote:
> Dear John,
> My DNA system has "-20" charges from (o1p) atoms and (+1) form SOD (atom
> 781) in the pdb file. In order to neutralize the system, I need to add 19
> SOD atoms using autoionize. I figured out that if I use 0.3 instead of
> 0.0001 in the command below:
> "autoionize -psf file.psf -pdb file.pdb -is 0.0001"
> The system net charge after adding ions is 8.53529961375e-007e while it was
> -18.9999991465e before adding ions. It seems that the program is adding 19
> Na and 0 Cl ions, total 19 ions in this case to balance the charge. My
> questions are:
> (1) Does 8.53529961375e-007e mean 8.53529961375810^-7? If yes, is this net
> charge now in neutralization by autoionize?

no. this is 0.000000853529961375 in scientific notation.
this is effectively 0 for single precision floating point numbers.

at this point it might be useful to add a reference to a
very important article on the subject of floating point math.
if you search for the title:
What every (computer) scientist should know about floating point arithmetic

you'll find a ton of pages referring to it. while it is addressed to
computer scientists, the result affects us all that use scientific
computing tools and one should go over it every once in a
while and be scared (how approximate the math is we are using)
and surprised (how well it still works) by it.

> (2) If I use 0.28 instead of 0.3, the final net charge is -0.999999146471e
> which is very different from what produced by 0.3. Is it because of rounding
> problem as you mentioned before?

if you read and understand the article mentioned above, you'll be able
to answer this question by yourself.

> Thanks,
> Parisa
> (2) If yes
> -----Original Message-----
> From: John Stone []
> Sent: Tue 7/6/2010 11:42 AM
> To: Parisa Akhski
> Cc:
> Subject: Re: vmd-l: Autoionize does not neutralize the system
> Hi,
>   Interestingly, in reading the current version of the code, there
> are a number of checks for this kind of problem.  It would seem
> that this particular case is exercising a code path that either
> isn't covered, or that you neglected to mention anything about warning
> messages that should have appeared when running the tool?
> It would be helpful to have the actual files that caused the problem,
> as there's clearly a case that's not being handled here.
> Which version of VMD are you running?  (so I can get a rough
> guess which version of autoionize you're using)
> Cheers,
>   John Stone
> On Tue, Jul 06, 2010 at 10:16:20AM -0400, Parisa Akhski wrote:
>>    Dear VMD users,
>>    I am using autoionize to neutralize a DNA molecule. I am using the
>> command
>>    below as posted on the VMD mailing list to make it only place enough
>> ions
>>    to neutralize the system:
>>    autoionize -psf file.psf -pdb file.pdb -is 0.0001
>>    The system net charge before adding ions is -18.9999991446e and after
>>    adding ions is -0.999999144592e. Isn't that supposed to be zero after
>>    adding ions? Or is it acceptable?
>>    Thanks in advance for your help,
>>    Parisa
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> Email:                 Phone: 217-244-3349
>   WWW:      Fax: 217-244-6078

Dr. Axel Kohlmeyer
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.