Calculation of free energy from potential and kinetic energy I am having trouble understanding how (and even whether it's possible) to get free energy from kinetic and potential energy.
I have run molecular dynamics simulations (NPT ensemble, CP2K software), but this is a basic thermodynamics question.  There's a results file called &quot;energy.&quot;  The file contains energy-related output: temperature, kinetic and potential energy, and a &quot;conserved&quot; quantity.
(The &quot;conserved quantity&quot; is the sum of the kinetic and potential energies and also the thermostat energies).
From courses a long time ago and reading I have done online, I know that
kinetic energy + potential energy = total energy

I think &quot;total energy&quot; would be the internal energy.  It would be great if someone could please confirm/debunk that--I don't know if the situation is distinct for distinct ensembles, for example.  Whatever the case, I don't know how it relates to the free energy.  I would like to know if I have enough information to calculate the free energy.
If anyone could please point me in the right direction, I would appreciate it.  I can't find anything online and maybe that's because I don't even know where to start looking.
The sum of the potential and kinetic energies is the internal energy, E (or U).
However, you don't necessarily need to know the entropy to calculate the free energy.  If you perform an equilibrium molecular dynamics simulation, you can derive the free energy from the equilibrium constant.
See, for instance:
https://onlinelibrary.wiley.com/doi/full/10.1002/jcc.21776
If you are modeling a constant T and V system, where there is no work done, the equilibrium constant would give you the Helmholtz free energy:
$$\Delta A = - R T ln K^{'}_{eq}$$
where A = E - TS
If you are modeling a constant T and p system, where you have no non-pV-work, the equilibrium constant would give you the Gibbs free energy:
$$\Delta G = - R T ln K^{''}_{eq}$$
where G = H - TS = E + pV - TS
The reason for this is that, at constant T and V, with no work term, minimizing A_sys corresponds to a maximization of S_univ, and thus determines the equilibrium condition. By contrast, at constant T and p, with pV-work only, minimizing G_sys corresponds to a maximization of S_univ, and thus determines the equilibrium condition.
I've marked the equilibrium constants as prime and double-prime to indicate that these would be numerically different.