@@ -3547,8 +3547,8 @@ \subsection{Tutorial 7: Free energy calculation}
35473547area in the middle of the simulation box without needing to simulate additional atoms.
35483548The procedure is valid for more complex systems and can be adapted to many other
35493549situations, such as measuring adsorption barriers near an interface or calculating
3550- translocation barriers through a membrane
3551- \cite { wilson1997adsorption , makarov2009computer , gravelle2021adsorption , loche2022molecular }.
3550+ translocation barriers through a membrane \cite { wilson1997adsorption , makarov2009computer ,
3551+ gravelle2021adsorption , loche2022molecular , hayatifar2024probing }.
35523552
35533553\subsubsection {Method 1: Free sampling }
35543554The most direct way to calculate a free energy profile is to extract the partition
@@ -3561,7 +3561,7 @@ \subsubsection{Method 1: Free sampling}
35613561where $ \Delta G$ is the free energy difference, $ R$ is the gas constant, $ T$
35623562is the temperature, $ p$ is the pressure, and $ p_0 $ is a reference pressure.
35633563As an illustration, let us apply this method to a simple configuration
3564- that consists of a few particles diffusing in a box in the presence of a
3564+ that consists of a particles in a box in the presence of a
35653565position-dependent repulsive force that makes the center of the box a less
35663566favorable area to explore.
35673567
@@ -3574,8 +3574,8 @@ \subsubsection{Method 1: Free sampling}
35743574variable sigma equal 3.405
35753575variable epsilon equal 0.238
35763576variable U0 equal 1.5*${epsilon}
3577- variable dlt equal 0.5
3578- variable x0 equal 5 .0
3577+ variable dlt equal 1.0
3578+ variable x0 equal 10 .0
35793579
35803580units real
35813581atom_style atomic
@@ -3599,7 +3599,7 @@ \subsubsection{Method 1: Free sampling}
35993599Let us define the simulation box and randomly add atoms by addying the
36003600following lines to \flecmd {free-energy.lmp}:
36013601\ begin{lstlisting}
3602- region myreg block -25 25 -5 5 -25 25
3602+ region myreg block -50 50 -15 15 -50 50
36033603create_box 1 myreg
36043604create_atoms 1 random 200 34134 myreg overlap 3 maxtry 50
36053605
@@ -3634,7 +3634,7 @@ \subsubsection{Method 1: Free sampling}
36343634\includegraphics [width=\linewidth ]{US-potential}
36353635\caption {Potential $ U$ given in Eq.\, \eqref {eq:U } (a) and force $ F$ given in
36363636Eq.\, \eqref {eq:F } (b) as a function of the coordinate $ x$ . Here,
3637- $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 0.5 ~\mathrm {\AA {}}$ , and $ x_0 = 5 ~\mathrm {\AA {}}$ .}
3637+ $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 1.0 ~\mathrm {\AA {}}$ , and $ x_0 = 10 ~\mathrm {\AA {}}$ .}
36383638\label {fig:potential }
36393639\end {figure }
36403640
@@ -3651,15 +3651,16 @@ \subsubsection{Method 1: Free sampling}
36513651Next, we combine the \lmpcmd {fix nve} with a \lmpcmd {fix langevin} thermostat:
36523652\ begin{lstlisting}
36533653fix mynve all nve
3654- fix mylgv all langevin 119.8 119.8 50 30917
3654+ fix mylgv all langevin 119.8 119.8 500 30917
36553655\end {lstlisting }
36563656When combining these two commands, the MD simulation operates
36573657in the NVT ensemble, maintaining a constant number of
36583658atoms $ N$ , constant volume $ V$ , and a temperature $ T$ that
36593659fluctuates around a target value.
3660+ % SG: may be discuss the choice of constant "500" --> chosen for a relatiely weak coupling with thermostat (add a box?)
36603661
36613662To ensure that the equilibration time is sufficient, we will track the evolution of
3662- the number of atoms in the central ( energetically unfavorable) region,
3663+ the number of atoms in the central -- energetically unfavorable -- region,
36633664referred to as \lmpcmd {mymes}, using the \lmpcmd {n\_ center} variable:
36643665\ begin{lstlisting}
36653666region mymes block -${x0} ${x0} INF INF INF INF
@@ -3668,41 +3669,44 @@ \subsubsection{Method 1: Free sampling}
36683669thermo 10000
36693670
36703671dump viz all image 50000 myimage-*.ppm type type &
3671- shiny 0.1 box yes 0.01 view 180 90 zoom 7 size 1600 400
3672- dump_modify viz backcolor white acolor 1 cyan adiam 1 1 &
3673- boxcolor black
3672+ shiny 0.1 box yes 0.01 view 180 90 zoom 6 &
3673+ size 1600 500 fsaa yes
3674+ dump_modify viz backcolor white acolor 1 cyan &
3675+ adiam 1 3 boxcolor black
36743676\end {lstlisting }
3675- A \lmpcmd {dump image} command was added for system visualization.
3677+ A \lmpcmd {dump image} command was also added for system visualization.
36763678
3677- Finally, let us perform an equilibration of 500000 steps
3678- in total, using a timestep of $ 2 \, \text {fs}$ (i.e.~ a total duration of $ 1 \, \text {ns} $ ) :
3679+ Finally, let us perform an equilibration of 50000 steps,
3680+ using a timestep of $ 2 \, \text {fs}$ , corresponding to a total duration of $ 100 \, \text {ps} $ :
36793681\ begin{lstlisting}
36803682timestep 2.0
3681- run 500000
3683+ run 50000
36823684\end {lstlisting }
3683- Run the simulation with LAMMPS. The number of atoms in the
3685+ Run the simulation with LAMMPS. The number of atoms in the
36843686central region, $ n_\mathrm {center}$ , reaches
3685- its equilibrium value after approximately $ 500 \, \text {ps}$
3687+ its equilibrium value after approximately $ 40 \, \text {ps}$
36863688(Fig.\, \ref {fig:US-density-evolution }). A snapshot of the
36873689equilibrated system is shown in Fig.\, \ref {fig:US-system-unbiased }.
36883690
36893691\paragraph {Run and data acquisition }
36903692
36913693Once the system is equilibrated, we will record the density profile of
3692- the atoms along the $ x$ axis using the \lmpcmd {ave/chunk} command. A total
3693- of 10 density profiles will be printed. Add the following line to \flecmd {free-energy.lmp}:
3694+ the atoms along the $ x$ axis using the \lmpcmd {ave/chunk} command.
3695+ Add the following line to \flecmd {free-energy.lmp}:
36943696\ begin{lstlisting}
36953697reset_timestep 0
36963698
3697- compute cc1 all chunk/atom bin/1d x 0.0 1.0
3698- fix myac all ave/chunk 10 400000 4000000 &
3699+ thermo 200000
3700+
3701+ compute cc1 all chunk/atom bin/1d x 0.0 2.0
3702+ fix myac all ave/chunk 100 20000 2000000 &
36993703 cc1 density/number file free-sampling.dat
37003704
3701- run 4000000
3705+ run 2000000
37023706\end {lstlisting }
37033707The step count is reset to 0 using \lmpcmd {reset\_ timestep} to synchronize it
3704- with the output times of \lmpcmd {fix density/number}. Increase the
3705- duration of the last run to obtain a better-resolved density profile .
3708+ with the output times of \lmpcmd {fix density/number}. Run the simulation using
3709+ LAMMPS .
37063710
37073711\begin {figure }
37083712\centering
@@ -3717,44 +3721,37 @@ \subsubsection{Method 1: Free sampling}
37173721\paragraph {Data analysis }
37183722
37193723Once the simulation is complete, the density profile shows that the density in the center of the box is
3720- about two orders of magnitude lower than inside the reservoir (Fig.\, \ref {fig:US-density }).
3724+ about two orders of magnitude lower than inside the reservoir (Fig.\, \ref {fig:US-density }\, a ).
37213725Next, we plot $ -R T \ln (\rho /\rho _\mathrm {bulk})$ (i.e.~Eq.\, \eqref {eq:G } where
37223726the pressure ratio $ p/p_\mathrm {bulk}$ is replaced by the density ratio
37233727$ \rho /\rho _\mathrm {bulk}$ , assuming the system behaves as an ideal gas) and compare it
3724- with the imposed potential $ U$ from Eq.\, \eqref {eq:U } (Fig.\, \ref {fig:US-FreeSampling } ).
3725- The reference density, $ \rho _\text {bulk} = 0.0033 ~\text {\AA {}}^{-3}$ ,
3728+ with the imposed potential $ U$ from Eq.\, \eqref {eq:U } (Fig.\, \ref {fig:US-density } \, b ).
3729+ The reference density, $ \rho _\text {bulk} = 0.0009 ~\text {\AA {}}^{-3}$ ,
37263730was estimated by measuring the density of the reservoir from the raw density
3727- profiles. The agreement between the MD results and the imposed energy profile
3728- is reasonable , despite some noise in the central part, where fewer data points
3731+ profiles. The agreement between the MD results and the imposed energy profile
3732+ is excellent , despite some noise in the central part, where fewer data points
37293733are available due to the repulsive potential.
37303734
37313735\begin {figure }
37323736\centering
37333737\includegraphics [width=\linewidth ]{US-system-unbiased}
37343738\caption {Snapshot of the system. The density of atoms is lowest in the central
37353739part of the box, \lmpcmd {mymes}, due to the additional force $ F$ . Here,
3736- $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 0.5 ~\mathrm {\AA {}}$ , and $ x_0 = 5 ~\mathrm {\AA {}}$ .}
3740+ $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 1.0 ~\mathrm {\AA {}}$ , and $ x_0 = 10 ~\mathrm {\AA {}}$ .}
37373741\label {fig:US-system-unbiased }
37383742\end {figure }
37393743
37403744\begin {figure }
37413745\centering
37423746\includegraphics [width=\linewidth ]{US-density}
3743- \caption {Fluid density $ \rho $ along the $ x$ direction. Here,
3744- $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 0.5 ~\mathrm {\AA {}}$ , $ x_0 = 5 ~\mathrm {\AA {}}$ ,
3745- and the reference density is $ \rho _\text {bulk} = 0.0033 ~\text {\AA {}}^{-3}$ .}
3747+ \caption {a) Fluid density $ \rho $ along the $ x$ direction.
3748+ b) Potential $ U$ as a function of $ x$ measured using free sampling (blue disks)
3749+ compared to the imposed potential given in Eq.\, \eqref {eq:U } (dark line).
3750+ Here, $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 1.0 ~\mathrm {\AA {}}$ , $ x_0 = 10 ~\mathrm {\AA {}}$ ,
3751+ and the measured reference density in the reservoir is $ \rho _\text {bulk} = 0.0009 ~\text {\AA {}}^{-3}$ .} % SG: check units of rho bulk
37463752\label {fig:US-density }
37473753\end {figure }
37483754
3749- \begin {figure }
3750- \centering
3751- \includegraphics [width=\linewidth ]{US-FreeSampling}
3752- \caption {Potential $ U$ as a function of $ x$ measured using free sampling (blue disks)
3753- compared to the imposed potential given in Eq.\, \eqref {eq:U } (dark line). Here,
3754- $ U_0 = 0.36 ~\text {kcal/mol}$ , $ \delta = 0.5 ~\mathrm {\AA {}}$ , and $ x_0 = 5 ~\mathrm {\AA {}}$ .}
3755- \label {fig:US-FreeSampling }
3756- \end {figure }
3757-
37583755\paragraph {The limits of free sampling }
37593756
37603757Increasing the value of $ U_0 $ reduces the average number of atoms in the central
0 commit comments