how to calculate free energy

Hi,

I think that the for the Einstein potential you should probably use the fix spring/self, it already fix the equilibrium position as the initial position of the atoms. You can even use fix_modify energy to include the potential energy of the springs on the total potential energy of the system (otherwise you can obtain it throught the global scalar computed by the fix itself).

Recently I used a variation of the thermodynamic integration to obtain the free energy of a solid, the procedure is exactly the same but the method is dynamic (it is called adiabatic switching), the only difference is that I used a different reference system, instead of the Einstein crystal I used the harmonic approximation of the crystal (it is the same crystal described by its normal modes throught the dynamical matrix).

Two things that I should tell you: first, the Nose-Hoover thermostat DO NOT WORK with harmonic oscillators, at least not the Nose-Hoover implemented in Lammps, if you want to know why search for Massively Nose-Hoover thermostat by Mark E. Tuckerman, you can see this behaviour also on the book Statistical Mechanics: Theory and Molecular simulations by the same autor. You should probably use Langevin thermostat. The second thing is that Steve is right, if you want to perform a thermodynamical integration using a potential that is not coded on fix adapt & compute ti combo (most of the useful potentials describing solids is notâ€¦) you will have to do a bit of coding.

To perform my thermodynamical integration using the dynamical matrix I had to write a fix that would slowly turning the solid potential (an EAM potential in my case) off and turning the einstein crystal (harmonic approximation in my case) on, it is not that hard to do, you should probably use the fix self/spring as a basis to do it. You just need some experience with MPI and the internal working of LAMMPS.

I have never seen someone using LAMMPS to do this, if more users have interest I can provide the fix as an user contribution.

Rodrigo Freitas