I would be very grateful for some newbie-level advice from a thermodynamics guru.

I ran NPT simulations on a particular system (in CP2K software) to get fluid densities for use in fluid dynamics applications. Before the lockdown, a colleague mentioned that it might be interesting to use the results for describing mixing in the system thermodynamically (the system is made up of two endmember compositions). I finally thought about it, but can't figure out if my NPT internal energy data are meaningful and don't want to bother my colleague, who has been sick. I would love advice.

I would like to know if I can simply sum my NPT ensemble-derived kinetic and potential energies to calculate internal energy. The reason I ask is that I came across a comment online where someone seemed to think the thermostat would interfere with the kinetic energy values.

I can't decide if this is true. I know that energy is not conserved for NPT simulations--that energy is either added or subtracted to maintain a constant temperature. However, it seems like that should be fine because I want the system to be at a particular temperature. I could run another set of simulations in a different ensemble. But that would mean a lot of extra time and computational resources, so I want to be really certain before diving in to doing more simulations.

With regard to energy not being conserved for NPT simulations, I'm wondering if it matters that my goal is to provide people with data on the thermodynamics of mixing in the system. In other words, for the data to be useful, I need to be compare internal energies from distinct simulations run at the same pressure and temperature, but different endmember fractions (compositions)--one internal energy value by itself probably won't be useful. I'm not sure if I'm being clear here... The bottom line is that I can't figure out if it would be like comparing apples and oranges to compare internal energy values from different NPT simulations (and therefore cannot use my existing results to describe the thermodynamics of this system).

I have searched online for information on this, but probably don't know enough to be familiar with useful search terms. If anyone has any hints on how to think this through, I'd be very appreciative. Thank you.

  • 3
    $\begingroup$ Welcome to the site! I love molecular dynamics questions. The answer is yes you can add the numbers together E=U+K. The value won't be "conserved" so there really isn't any reason to plot it. E.g. usually one could plot the conserved values to see if the dynamics are stable. See this [excellent answer by Phil[(mattermodeling.stackexchange.com/a/644/52) $\endgroup$
    – Cody Aldaz
    Commented Aug 13, 2020 at 19:03
  • $\begingroup$ +1. Welcome to the site, and thank you for asking your question here! We hope to see much more of you in the future !!! $\endgroup$ Commented Aug 13, 2020 at 19:05
  • 1
    $\begingroup$ I would also use the total energy as a metric to understand if the system is properly equilibrated. From my understanding, the kinetic energy term is mainly as a result of the temperature that the thermostat is set to - so I don't think it holds any physical meaning. However, I would think the potential energy is more meaningful - e.g. to answer questions like if a sharp fluctuation in PE at a timestep results from a specific interaction change say hydrogen bond disruption. I think it is also reasonable to compare RELATIVE AVERAGE PE since MD is a statistical mechanics approach. $\endgroup$
    – gogo
    Commented Aug 14, 2020 at 1:08
  • 1
    $\begingroup$ Sorry for jargonizing the answer. I think potential energy is the same as internal energy and since it is a MD, you will need to average the internal energy over a certain time interval where the system is equilibrated. Let's say you have a reaction A --> B (or any state A and B). Then the relative energy, <deltaE> = <E(B)> - <E(A)>, where <> represent the time-averaged energies, should be meaningful. I don't see why you can not do the same as per your needs as a f(T,P). You may want to consider testing the effect of thermostat and barostat on the relative energies. $\endgroup$
    – gogo
    Commented Aug 14, 2020 at 23:24
  • 2
    $\begingroup$ The internal energy should be the sum of kinetic and potential energy. The fact that the total energy is not conserved is perfectly fine as that is true of the real system interacting with the heat bath which keeps it at a constant temperature. You will want to average the internal energy of the simulation until it is converged. Then, you can do the same thing with varying compositions in your system. I know of people who do similar things for cholesterol in lipid bilayers, but I believe they usually report free energies rather internal energies. $\endgroup$
    – jheindel
    Commented Aug 20, 2020 at 7:42

1 Answer 1


Energy in an NPT simulation is not conserved, but (once equilibrated), it will fluctuate around an average value, and that average value has meaning. That is the ensemble average for your NPT and is a valuable and useful property.

You are also correct that the internal energy is the summation of potential and kinetic contributions. To be thorough, pp. 60 of Computer Simulations Of Liquids by Allen & Tildesley (2nd edition) note

\begin{equation} E = \langle H\rangle = \langle \mathcal{K} \rangle + \langle \mathcal{V} \rangle \end{equation} where E is internal energy, H is Hamiltonian, $\mathcal{K}$ is kinetic energy and $\mathcal{V}$ is potential energy (calculated using a force-field in this case). I recommend Allen & Tildesley as well as Frenkel & Smit if you want more information on gathering ensemble averaged properties from atomistic simulations. They are the two tomes of the field.

It is fair to compare the internal energies of two different composition simulations. It is however critical that both simulations are properly equilibrated and sampled so that $\langle \mathcal{K} \rangle$ and $\langle \mathcal{V} \rangle$ are reliable estimates.

I recommend equilibrating for several nanoseconds at the least, and sampling for several nanoseconds at the least.

  • $\begingroup$ I didn't realize there was a bounty until after I answered. That is a nice addition I guess :) $\endgroup$
    – B. Kelly
    Commented Sep 4, 2020 at 18:48
  • $\begingroup$ You can't really read the question without seeing the big blue bounty notice between the question's title and the question's body! $\endgroup$ Commented Sep 4, 2020 at 18:54
  • $\begingroup$ You can pass over it if you haven't slept very much and skip to the comments first, then scroll up the question :) $\endgroup$
    – B. Kelly
    Commented Sep 4, 2020 at 18:55
  • $\begingroup$ That indeed is possible :) $\endgroup$ Commented Sep 4, 2020 at 19:12
  • $\begingroup$ @CharlieCrown, thank you so much. I didn't think I was going to get any takers for this question and got a very nice surprise just now when I checked back! $\endgroup$
    – NTS
    Commented Nov 18, 2020 at 16:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .