# CP2K Open Source Molecular Dynamics

### Site Tools

exercises:2014_uzh_molsim:nacl_free_energy

# Profiles of potential energy and free energy

We are going to start with the simplified example of isolated $\text{Na}^+$ and $\text{Cl}^-$ in the gas phase, where we can directly compare the results of our computer simulation against the analytical formulae used to describe the interaction potential.

We have provided an input file NaCl_pot.in and a script potential_energy.sh that uses this input file to calculate the potential energy as a function of Na-Cl distance.

1. Look into NaCl_pot.in and write down the formula used for the potential energy of the interaction between $\text{Na}^+$ and $\text{Cl}^-$ in Hartree atomic units. (2P)
2. Use ./potential_energy.sh to calculate the potential energy as a function of Na-Cl distance. Create a plot of the resulting potential energy profile in pot_profile and the mathematical formula.
3. What do you observe, when the distance approaches 1/2 of the simulation box? How might the finite size of the simulation box have impacted the MD simulation in the previous exercise? (2P)

For the next task, we remain with our simple system, but now perform molecular dynamics at $T=1\,\text{K}$.

We have prepared a script free_energy.sh, which runs MD simulations with constrained Na-Cl distance at $1\,\text{K}$. It then integrates the average value of the Shake Lagrange multiplier to calculate the (low-temperature) free energy profile.

1. What is a Lagrange multiplier? How can we obtain the free energy profile as a function of the Na-Cl distance using the associated Lagrange multiplier? (2P)
2. Run the simulation. What kind of motion does the NaCl dimer perform?
3. Compare the low-temperature free energy profile in fe_profile with the potential energy profile. Do the two profiles agree? Note: The profiles are shifted with respect to each other. What would be a reasonable reference point for both profiles? (2P)
4. What effects would you expect at higher temperature? Hint: If you like, you can adapt the temperature in the input file and give it a go.

Now, we are ready to move to a more realistic system – NaCl in water. We have performed constrained MD of NaCl in water and saved the trajectory of the corresponding Lagrange multipliers (ask your teaching assistant).

The script ./integrate.sh computes the average values of the Shake Lagrange multipliers and uses them to perform the free energy integration.

Another way to gain access to the free energy is through the radial distribution function (rdf) of the unconstrained system. The rdf $g(r)$ is related to the free energy $F(r)$ through the following set of equations $$\begin{eqnarray} g(r)4\pi r^2 &\propto& \int \delta(r-r') \exp(-\beta H(r'))\,dr \\ P(r) &\propto& \int \delta(r-r') \exp(-\beta H(r'))\,dr \\ F(r) &=& -k_BT \ln\,P(r) \end{eqnarray}$$