[Pw_forum] dist.x giving NaN values for angles

Lorenzo Paulatto lorenzo.paulatto at impmc.upmc.fr
Thu Feb 20 23:44:40 CET 2014


On 02/20/2014 10:47 PM, Laalitha Liyanage wrote:
> Is this a problem in the code or something I am doing wrong. I have used
> the largest distance possible for the cutoff.
> I have attached input files (box, cmd.in) and the output (rdf.dat).

dist.x uses the acos(x) function to compute the angle. It would return
NaN if the absolute value of its argument is greater than one.

In your case a bit of numerical noise adds up and causes the arg to be
-1.0000000000000002. I'm uploading a fix to the SVN, just assume the
angle to be 180° for practical purposes.

thank you for reporting
-- 
Dr. Lorenzo Paulatto
IdR @ IMPMC -- CNRS & Université Paris 6
phone:+33 (0)1 44275 084 / skype: paulatz
www:  http://www-int.impmc.upmc.fr/~paulatto/
mail: 23-24/4é16 Boîte courrier 115, 4 place Jussieu 75252 Paris Cédex 5



More information about the users mailing list