Question Regarding fix langevin

The system consists of 1000 particles (not interacting with each other) which are subjected to a Langevin bath. The corresponding fix is as follows:
fix fxlang all langevin 298 298 0.077855 8765 angmom no
I chose the damping factor so as to mimic Xenon particles in water.

The time step for the simulation is 1fs.
I have dumped unscaled positions and velocities in a dump file and used those to generate the distributions for displacement and velocity.
It is expected that both displacement and velocity will have a Gaussian distribution with 0 mean.

I have shown the histograms for velocity (left) and displacement (right), the corresponding mean values are 0.05 Å/ps and 2.1 Å. Considering that the “size” of Xenon atoms is roughly 3.9 Å, this error seems to be too large.

I thought that increasing the number of particles might improve the distribution, so I took 10,000 particles and repeated the steps. The mean values were 0.001 Å/ps and 0.5 Å.

Are such errors acceptable or are there any ways to fine tune it ? Or am I missing or ignoring some factor ?

Thank you.

Sorry, that is mostly a question about the method and its details than it is about LAMMPS.
The distribution can only be as good as the one from the pseudo random number generator in use is.
You would have to write some custom code based on what is in the RandomMars class.

It is an open project to add a feature to LAMMPS to make the choice of random number generators configurable (there are currently three in use with different requirements and properties, but you cannot select or replace them). There is some prototype code in a very old version of LAMMPS, but we have not had the time to finalize it.

1 Like