[Physics] Molecular Dynamics (MD) Simulation: energy fluctuations in NVE ensemble

molecular dynamicsstatistical mechanics

I'm writing my first MD simulation (ever) for liquid Argon. The code is up and running. I am supposed to do the calculations in the NVE ensemble. Having implemented a 4th order symplectic integrator (forest-ruth) the total energy of my system (approx 1000 atoms) oscillates (as expected).

Now I am "measuring" the heat capacity of my system, which I do by calculating the mean total energy and it's fluctuations for several distinct simulations (using the same parameters).

This is exactly the point that I don't get (conceptually). By definition, the total energy of a system is fixed in the microcanonical ensemble. Am I in the microcanonical or in the canonical ensemble when I do an MD simulation? The literature (I have) is somewhat sloppy when it comes to this.

Best Answer

A month (and lots of lines of code) later, I have finally gained a better understanding of what I have been asking here previously. The book by Frenkel and Smit shed some light into this: when you are running an MD simulation, you are doing this in in something that is very close to the NVE ensemble. It is possible to run an MD simulation in something that is very close to the NVT ensemble by carefully implementing a thermostat.

Contrarily to what Nick has answered, I did measure the heat capacity through fluctuations, which produced very good results and is also recommended in the literature [Frenkel,Smit: Understanding MolecularSimulation ; Allen,Tildesley: Computer Simulation of Liquids].

I compared those measurements to measuring the heat capacity by interpolating energy measurements at different temperatures. The results were clearly inferior to computing the heat capacity from fluctuations.

If you are interested, here is my full report on the project and here is the source code in Python.