Why print command is not printing the value i am asking for

Hi All,

I am creating vx, vy and vz speed components by using Gaussian Dist and then I want to check if the vz speed component is smaller or larger than zero because if it is smaller than zero I want to stop the simulation. Below one is the input and output files. As it is seen print command is printing a different value for vz speed component. Why it is happening? I would appreciate your help.

Thanks,
Rose

Hi All,

I am creating vx, vy and vz speed components by using Gaussian Dist and then I want to check if the vz speed component is smaller or larger than zero because if it is smaller than zero I want to stop the simulation. Below one is the input and output files. As it is seen print command is printing a different value for vz speed component. Why it is happening? I would appreciate your help.

I already answered your question.

...and let me add that the print command *does* print what you are
asking for. the problem is that you don't ask for what you want.

here are two important lines that feature prominently in the
documentation of the variable command:

Variables of style equal store a formula which when evaluated produces
a single numeric value which can be output either directly (see the
print, fix print, and run every commands) or as part of thermodynamic
output (see the thermo_style command), or used as input to an
averaging fix (see the fix ave/time command)

and:

IMPORTANT NOTE: When the input script line is encountered that defines
a variable of style equal or atom or python that contains a formula or
Python code, the formula is NOT immediately evaluated