Add equation numbers in reference manual
[alexxy/gromacs.git] / docs / reference-manual / functions / free-energy-interactions.rst
index 6fd043c49c0ad910049c7148343c6ce34e3c72d8..1d48ce7c0d7a3d7cc0ea6e92eb6541178082f5ba 100644 (file)
@@ -24,16 +24,15 @@ The example given here is for the bond potential, which is harmonic in
 |Gromacs|. However, these equations apply to the angle potential and the
 improper dihedral potential as well.
 
-.. math::
-
-   \begin{aligned}
-   V_b     &=&{\frac{1}{2}}\left[{(1-{\lambda})}k_b^A + 
-                   {\lambda}k_b^B\right] \left[b - {(1-{\lambda})}b_0^A - {\lambda}b_0^B\right]^2  \\
-   {\frac{\partial V_b}{\partial {\lambda}}}&=&{\frac{1}{2}}(k_b^B-k_b^A)
-                   \left[b - {(1-{\lambda})}b_0^A + {\lambda}b_0^B\right]^2 + 
-               \nonumber\\
-           & & \phantom{{\frac{1}{2}}}(b_0^A-b_0^B) \left[b - {(1-{\lambda})}b_0^A -{\lambda}b_0^B\right]
-               \left[{(1-{\lambda})}k_b^A + {\lambda}k_b^B \right]\end{aligned}
+.. math:: \begin{aligned}
+          V_b     &=&{\frac{1}{2}}\left[{(1-{\lambda})}k_b^A + 
+                          {\lambda}k_b^B\right] \left[b - {(1-{\lambda})}b_0^A - {\lambda}b_0^B\right]^2  \\
+          {\frac{\partial V_b}{\partial {\lambda}}}&=&{\frac{1}{2}}(k_b^B-k_b^A)
+                          \left[b - {(1-{\lambda})}b_0^A + {\lambda}b_0^B\right]^2 + 
+                       \nonumber\\
+                  & & \phantom{{\frac{1}{2}}}(b_0^A-b_0^B) \left[b - {(1-{\lambda})}b_0^A -{\lambda}b_0^B\right]
+                       \left[{(1-{\lambda})}k_b^A + {\lambda}k_b^B \right]\end{aligned}
+          :label: eqnfepharmpot
 
 GROMOS-96 bonds and angles
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -47,22 +46,21 @@ Proper dihedrals
 
 For the proper dihedrals, the equations are somewhat more complicated:
 
-.. math::
-
-   \begin{aligned}
-   V_d     &=&\left[{(1-{\lambda})}k_d^A + {\lambda}k_d^B \right]
-           \left( 1+ \cos\left[n_{\phi} \phi - 
-                   {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B
-                   \right]\right)\\
-   {\frac{\partial V_d}{\partial {\lambda}}}&=&(k_d^B-k_d^A) 
-            \left( 1+ \cos
-                \left[
-                   n_{\phi} \phi- {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B
-                \right]
-        \right) +
-        \nonumber\\
-           &&(\phi_s^B - \phi_s^A) \left[{(1-{\lambda})}k_d^A - {\lambda}k_d^B\right] 
-           \sin\left[  n_{\phi}\phi - {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B \right]\end{aligned}
+.. math:: \begin{aligned}
+          V_d     &=&\left[{(1-{\lambda})}k_d^A + {\lambda}k_d^B \right]
+                  \left( 1+ \cos\left[n_{\phi} \phi - 
+                           {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B
+                           \right]\right)\\
+          {\frac{\partial V_d}{\partial {\lambda}}}&=&(k_d^B-k_d^A) 
+                   \left( 1+ \cos
+                        \left[
+                           n_{\phi} \phi- {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B
+                        \right]
+                \right) +
+                \nonumber\\
+                  &&(\phi_s^B - \phi_s^A) \left[{(1-{\lambda})}k_d^A - {\lambda}k_d^B\right] 
+                  \sin\left[  n_{\phi}\phi - {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B \right]\end{aligned}
+          :label: eqnfeppropdihedral
 
 **Note:** that the multiplicity :math:`n_{\phi}` can not be
 parameterized because the function should remain periodic on the
@@ -74,11 +72,10 @@ Tabulated bonded interactions
 For tabulated bonded interactions only the force constant can
 interpolated:
 
-.. math::
-
-   \begin{aligned}
-         V  &=& ({(1-{\lambda})}k^A + {\lambda}k^B) \, f \\
-   {\frac{\partial V}{\partial {\lambda}}} &=& (k^B - k^A) \, f\end{aligned}
+.. math:: \begin{aligned}
+                V  &=& ({(1-{\lambda})}k^A + {\lambda}k^B) \, f \\
+          {\frac{\partial V}{\partial {\lambda}}} &=& (k^B - k^A) \, f\end{aligned}
+          :label: eqnfeptabbonded
 
 Coulomb interaction
 ~~~~~~~~~~~~~~~~~~~
@@ -86,11 +83,10 @@ Coulomb interaction
 The Coulomb interaction between two particles of which the charge varies
 with :math:`{\lambda}` is:
 
-.. math::
-
-   \begin{aligned}
-   V_c &=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[{(1-{\lambda})}q_i^A q_j^A + {\lambda}\, q_i^B q_j^B\right] \\
-   {\frac{\partial V_c}{\partial {\lambda}}}&=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[- q_i^A q_j^A + q_i^B q_j^B\right]\end{aligned}
+.. math:: \begin{aligned}
+          V_c &=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[{(1-{\lambda})}q_i^A q_j^A + {\lambda}\, q_i^B q_j^B\right] \\
+          {\frac{\partial V_c}{\partial {\lambda}}}&=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[- q_i^A q_j^A + q_i^B q_j^B\right]\end{aligned}
+          :label: eqnfepcoloumb
 
 where :math:`f = \frac{1}{4\pi \varepsilon_0} = {138.935\,458}` (see
 chapter :ref:`defunits`).
@@ -146,17 +142,16 @@ m :math:`\mathbf{v}`, since that would result in the
 sign of :math:`{\frac{\partial E_k}{\partial {\lambda}}}` being
 incorrect \ :ref:`99 <refGunsteren98a>`):
 
-.. math::
-
-   \begin{aligned}
-   E_k      &=&     {\frac{1}{2}}\frac{\mathbf{p}^2}{{(1-{\lambda})}m^A + {\lambda}m^B}        \\
-   {\frac{\partial E_k}{\partial {\lambda}}}&=&    -{\frac{1}{2}}\frac{\mathbf{p}^2(m^B-m^A)}{({(1-{\lambda})}m^A + {\lambda}m^B)^2}\end{aligned}
+.. math:: \begin{aligned}
+          E_k      &=&     {\frac{1}{2}}\frac{\mathbf{p}^2}{{(1-{\lambda})}m^A + {\lambda}m^B}        \\
+          {\frac{\partial E_k}{\partial {\lambda}}}&=&    -{\frac{1}{2}}\frac{\mathbf{p}^2(m^B-m^A)}{({(1-{\lambda})}m^A + {\lambda}m^B)^2}\end{aligned}
+          :label: eqnfepekin
 
 after taking the derivative, we *can* insert
-:math:`\mathbf{p}` =
-m :math:`\mathbf{v}`, such that:
+:math:`\mathbf{p}` = m :math:`\mathbf{v}`, such that:
 
 .. math:: {\frac{\partial E_k}{\partial {\lambda}}}~=~    -{\frac{1}{2}}\mathbf{v}^2(m^B-m^A)
+          :label: eqnfepekinderivative
 
 Constraints
 ~~~~~~~~~~~
@@ -167,6 +162,7 @@ calculated using the LINCS or the SHAKE algorithm. If we have
 :math:`k = 1 \ldots K` constraint equations :math:`g_k` for LINCS, then
 
 .. math:: g_k     =       | \mathbf{r}_{k} | - d_{k}
+          :label: eqnfepconstr
 
 where :math:`\mathbf{r}_k` is the displacement vector
 between two particles and :math:`d_k` is the constraint distance between
@@ -174,32 +170,33 @@ the two particles. We can express the fact that the constraint distance
 has a :math:`{\lambda}` dependency by
 
 .. math:: d_k     =       {(1-{\lambda})}d_{k}^A + {\lambda}d_k^B
+          :label: eqnfepconstrdistdep
 
 Thus the :math:`{\lambda}`-dependent constraint equation is
 
 .. math:: g_k     =       | \mathbf{r}_{k} | - \left({(1-{\lambda})}d_{k}^A + {\lambda}d_k^B\right).
+          :label: eqnfepconstrlambda
 
 The (zero) contribution :math:`G` to the Hamiltonian from the
 constraints (using Lagrange multipliers :math:`\lambda_k`, which are
 logically distinct from the free-energy :math:`{\lambda}`) is
 
-.. math::
-
-   \begin{aligned}
-   G           &=&     \sum^K_k \lambda_k g_k    \\
-   {\frac{\partial G}{\partial {\lambda}}}    &=&     \frac{\partial G}{\partial d_k} {\frac{\partial d_k}{\partial {\lambda}}} \\
-               &=&     - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned}
+.. math:: \begin{aligned}
+          G           &=&     \sum^K_k \lambda_k g_k    \\
+          {\frac{\partial G}{\partial {\lambda}}}    &=&     \frac{\partial G}{\partial d_k} {\frac{\partial d_k}{\partial {\lambda}}} \\
+                      &=&     - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned}
+          :label: eqnconstrfreeenergy
 
 For SHAKE, the constraint equations are
 
 .. math:: g_k     =       \mathbf{r}_{k}^2 - d_{k}^2
+          :label: eqnfepshakeconstr
 
 with :math:`d_k` as before, so
 
-.. math::
-
-   \begin{aligned}
-   {\frac{\partial G}{\partial {\lambda}}}    &=&     -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned}
+.. math:: \begin{aligned}
+          {\frac{\partial G}{\partial {\lambda}}}    &=&     -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned}
+          :label: eqnfepshakeconstr2
 
 Soft-core interactions
 ~~~~~~~~~~~~~~~~~~~~~~
@@ -234,14 +231,13 @@ In |Gromacs| the soft-core potentials :math:`V_{sc}` are shifted versions
 of the regular potentials, so that the singularity in the potential and
 its derivatives at :math:`r=0` is never reached:
 
-.. math::
-
-   \begin{aligned}
-   V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B)
-       \\
-   r_A &=& \left(\alpha \sigma_A^6 {\lambda}^p + r^6 \right)^\frac{1}{6}
-       \\
-   r_B &=& \left(\alpha \sigma_B^6 {(1-{\lambda})}^p + r^6 \right)^\frac{1}{6}\end{aligned}
+.. math:: \begin{aligned}
+          V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B)
+              \\
+          r_A &=& \left(\alpha \sigma_A^6 {\lambda}^p + r^6 \right)^\frac{1}{6}
+              \\
+          r_B &=& \left(\alpha \sigma_B^6 {(1-{\lambda})}^p + r^6 \right)^\frac{1}{6}\end{aligned}
+          :label: eqnfepsoftcore
 
 where :math:`V^A` and :math:`V^B` are the normal “hard core” Van der
 Waals or electrostatic potentials in state A (:math:`{\lambda}=0`) and
@@ -258,31 +254,29 @@ the interactions very little for :math:`r > \alpha^{1/6} \sigma` and
 quickly switch the soft-core interaction to an almost constant value for
 smaller :math:`r` (:numref:`Fig. %s <fig-softcore>`). The force is:
 
-.. math::
-
-   F_{sc}(r) = -\frac{\partial V_{sc}(r)}{\partial r} =
-    {(1-{\lambda})}F^A(r_A) \left(\frac{r}{r_A}\right)^5 +
-   {\lambda}F^B(r_B) \left(\frac{r}{r_B}\right)^5
+.. math:: F_{sc}(r) = -\frac{\partial V_{sc}(r)}{\partial r} =
+           {(1-{\lambda})}F^A(r_A) \left(\frac{r}{r_A}\right)^5 +
+          {\lambda}F^B(r_B) \left(\frac{r}{r_B}\right)^5
+          :label: eqnfepsoftcoreforce
 
 where :math:`F^A` and :math:`F^B` are the “hard core” forces. The
 contribution to the derivative of the free energy is:
 
-.. math::
-
-   \begin{aligned}
-   {\frac{\partial V_{sc}(r)}{\partial {\lambda}}} & = &
-    V^B(r_B) -V^A(r_A)  + 
-       {(1-{\lambda})}\frac{\partial V^A(r_A)}{\partial r_A}
-                  \frac{\partial r_A}{\partial {\lambda}} + 
-       {\lambda}\frac{\partial V^B(r_B)}{\partial r_B}
-                  \frac{\partial r_B}{\partial {\lambda}}
-   \nonumber\\
-   &=&
-    V^B(r_B) -V^A(r_A)  + \nonumber \\
-    & &
-    \frac{p \alpha}{6}
-          \left[ {\lambda}F^B(r_B) r^{-5}_B \sigma_B^6 {(1-{\lambda})}^{p-1} -
-              {(1-{\lambda})}F^A(r_A) r^{-5}_A \sigma_A^6 {\lambda}^{p-1} \right]\end{aligned}
+.. math:: \begin{aligned}
+          {\frac{\partial V_{sc}(r)}{\partial {\lambda}}} & = &
+           V^B(r_B) -V^A(r_A)  + 
+               {(1-{\lambda})}\frac{\partial V^A(r_A)}{\partial r_A}
+                          \frac{\partial r_A}{\partial {\lambda}} + 
+               {\lambda}\frac{\partial V^B(r_B)}{\partial r_B}
+                          \frac{\partial r_B}{\partial {\lambda}}
+          \nonumber\\
+          &=&
+           V^B(r_B) -V^A(r_A)  + \nonumber \\
+           & &
+           \frac{p \alpha}{6}
+                 \left[ {\lambda}F^B(r_B) r^{-5}_B \sigma_B^6 {(1-{\lambda})}^{p-1} -
+                      {(1-{\lambda})}F^A(r_A) r^{-5}_A \sigma_A^6 {\lambda}^{p-1} \right]\end{aligned}
+          :label: eqnfepsoftcorederivative
 
 The original GROMOS Lennard-Jones soft-core
 function\ :ref:`100 <refBeutler94>` uses :math:`p=2`, but :math:`p=1` gives a smoother
@@ -321,14 +315,13 @@ that in most cases gives lower and more even statistical variance than
 the standard soft-core path described above \ :ref:`101 <refPham2011>`,
 :ref:`102 <refPham2012>`. Specifically, we have:
 
-.. math::
-
-   \begin{aligned}
-   V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B)
-       \\
-   r_A &=& \left(\alpha \sigma_A^{48} {\lambda}^p + r^{48} \right)^\frac{1}{48}
-       \\
-   r_B &=& \left(\alpha \sigma_B^{48} {(1-{\lambda})}^p + r^{48} \right)^\frac{1}{48}\end{aligned}
+.. math:: \begin{aligned}
+          V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B)
+              \\
+          r_A &=& \left(\alpha \sigma_A^{48} {\lambda}^p + r^{48} \right)^\frac{1}{48}
+              \\
+          r_B &=& \left(\alpha \sigma_B^{48} {(1-{\lambda})}^p + r^{48} \right)^\frac{1}{48}\end{aligned}
+          :label: eqnnewsoftcore
 
 This “1-1-48” path is also implemented in |Gromacs|. Note that for this
 path the soft core :math:`\alpha` should satisfy