Using particle speed in ave/histo

Hi all,

I am trying to use ave/histo but instead of outputting the velocity components, I would like to create a histogram of speed in a 3D simulation. Any recommended way?
Also, is averaging of ave/histo done based on particle ID over multiple runs and then creating one histogram or it is the average of the histogram across multiple runs? My understanding is that these are statistically different.

Thank you very much!

The total speed of a particle is easily obtained with an atom style variable:

variable vel atom sqrt(vx*vx+vy*vy+vz*vz)

The histogram is counting entries to histogram columns over atoms in the fix group and is doing so over timesteps as described by the documentation.

I don’t understand what you are asking. The documentation is very clear about what it accumulates and how. Also how you can achieve different treatment of how to sum over different individual data sets collected every Nfreq steps with the optional “ave” keyword. You get to pick and choose what you want.

1 Like