[lammps-users] Total energy fluctuations on NVE ensemble

Hello everyone,

I have a simple Lenard-Jones system with two atom types. One is in the liquid phase and the other one is in the solid phase (different LJ parameters). In the NVE ensemble, total energy fluctuates around an average value as shown in the attachment. However, the total energy can not fluctuate in the NVE ensemble from a theoretical standpoint. Is this normal?

Brian Lancaster

The total energy can very well fluctuate because you are not solving the equations of motion analytically but numerically, because you are using a model which employs a cutoff, and to a lesser degree also because you are using floating point numbers with finite precision.

The amount of fluctuations will depend on the number of atoms, the amount of discretization (= length of timestep), the choice of cutoff, the integration algorithm and more.
If you run for long enough and compute a suitable running average, you will also see a (small) drift which is due to error accumulation. It should be kept small though for a good approximation.

Mind you, the relative error in your graph is around 2e-5 so not overly large.