# How to control temperature in NVE molecular dynamics

I want to simulate a molecular system at a certain temperature. It would be best if it could be implemented by NVT molecular dynamics. However, if one were to use a NVE simulation (like velocity Verlet), how could I fix the temperature, or let the temperature only fluctuate a little bit around the desired value?

• By definition, an NVE ensemble does not have fixed temperature. Oct 11 '16 at 2:35
• You need to use a thermostat algorithm. Any and every textbook on simulation covers thermostats. I recommend that you spend some time in the library... Try Frenkel & Smit and/or Allen & Tildesley Feb 7 '19 at 16:26

In my quite limited knowledge, there is no straightforward way to simulate a system with $NVE$-ensemble and get a (nearly) constant temperature.

You could approach this problem by starting with an $NVT$-ensemble. Set up the system, run energy minimization, generate velocities and use the velocity rescaling method until you are close to the wanted temperature. Once you are close to $T_{wanted}$, switch to a more gentle method, like Berendsen weak coupling or use a thermostat, such as Nose-Hoover.

After the system has thermalized, you can switch to $NVE$ and run the production simulation.

I don't have the privilege to post any links, but a simple google search with the keywords 'NVE MD simulation temperature control' will provide a good amount of references.

It depends on what you mean by $NVE$; if you want to do dynamics in a constant energy ensemble, and you consider the total system energy to be composed of the sum of kinetic and potential energies of your system, one can contemplate three ensembles: $NVE_{tot}$, $NVE_{kin}$ and $NVE_{pot}$, where the total, kinetic and potential energies are conserved, respectively, for all time.

Temperature, in the MD sense, corresponds to the instantaneous kinetic energy of a system. However, there are no constraints placed on the kinetic energy of the system in the $NVE_{tot}$ ensemble (other than summing with the potential energy gives a constant value for all times).

In contrast, the isokinetic ensemble, $NVE_{kin}$, requires that the kinetic energy, and therefore the instantaneous temperature, remains constant for all time, which appears to be what you want. Tuckerman discusses the various schemes one can use in his book quite comprehensively.