[lammps-users] Unusual drop in the histogram of particles at the two ends of a periodic direction

Hello LAMMPS community,

I have question which is not about running LAMMPS or doing a simulation, but it is about producing histogram from the LAMMPS output. In short, to generate the histogram, I used numpy.hostigram from Python and a for loop on the number of time-steps.

I have some particles in a cylinder with periodic boundary condition along its axis of symmetry (z direction). I produced a histogram of these particles along the z direction — Please see the attached value.

The histogram correctly shows the physics I expect: The histogram should have low values in the middle of the cylinder (|z|<=z_transition) and fluctuate around a constant value as the bin approach either of two ends (z_transition<|z|<=z_end).

However, the picture breaks down near the end of the cylinder; histogram values in the end bins are significantly lower than other bins in the range of z_transition<|z|<=z_end.

Changing the bin-size does not solve the issue, but makes the plot smoother.

Is this abnormally due to the PBC? Did I miss something in generating this histogram?

Thank you in advance for your response.
Kind regards,
Amir

histogram.pdf (21.7 KB)

Hi Amir,

It is difficult to answer without seeing your Python script. Also its not clear what is a “histogram of particle”? Is it the non-normalised density in particles along the axis?

May be you can have a look at the MAICoS density module :

It allows you to extract density profile in cartesian and cylindrical coordinate from LAMMPS trajectory files, you can use it to compare with your results.

Best,

Simon

This 20% drop is almost certainly an artefact of the binning method and has nothing to do with LAMMPS. You could probably fix this by choosing different zmin, zmax in your binning method, or you could just delete those two end points.

Aidan