Merge branch release-5-0
[alexxy/gromacs.git] / docs / manual / forcefield.tex
index 13e7e6b33ba8271ba2ba8d148213c832a2e15e6e..7e835ae7fb3c15b492697991ea5ac6afa4b7f7f1 100644 (file)
@@ -1,7 +1,7 @@
 %
 % This file is part of the GROMACS molecular simulation package.
 %
-% Copyright (c) 2013,2014, by the GROMACS development team, led by
+% Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
 % Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 % and including many others, as listed in the AUTHORS file in the
 % top-level source directory and at http://www.gromacs.org.
@@ -1058,9 +1058,12 @@ radius. The force acts towards the center of the sphere. The following distance
 \beq
   d_g(\ve{r}_i;\ve{R}_i) = |\ve{r}_i-\ve{R}_i|
 \eeq
-{\bfseries Cylinder} ($g=2$): The particle is kept in a cylinder of given radius
-parallel to the $z$-axis. The force from the flat-bottomed potential acts
-towards the axis of the cylinder. The $z$-component of the force is zero.
+{\bfseries Cylinder} ($g=6,7,8$): The particle is kept in a cylinder of given radius
+parallel to the $x$ ($g=6$), $y$ ($g=7$), or $z$-axis ($g=8$). For backwards compatibility, setting
+$g=2$ is mapped to $g=8$ in the code so that old {\tt .tpr} files and topologies work.  
+The force from the flat-bottomed potential acts towards the axis of the cylinder. 
+The component of the force parallel to the cylinder axis is zero.
+For a cylinder aligned along the $z$-axis:
 \beq
  d_g(\ve{r}_i;\ve{R}_i) = \sqrt{ (x_i-X_i)^2 + (y_i - Y_i)^2 }
 \eeq
@@ -1778,27 +1781,42 @@ after taking the derivative, we {\em can} insert \ve{p} = m\ve{v}, such that:
 
 \subsubsection{Constraints}
 \label{subsubsec:constraints}
-\newcommand{\clam}{C_{\lambda}}
 The constraints are formally part of the Hamiltonian, and therefore
 they give a contribution to the free energy. In {\gromacs} this can be
 calculated using the \normindex{LINCS} or the \normindex{SHAKE} algorithm.
-If we have a number of constraint equations $g_k$:
+If we have $k = 1 \ldots K$ constraint equations $g_k$ for LINCS, then
 \beq
-g_k     =       \ve{r}_{k} - d_{k}
+g_k     =       |\ve{r}_{k}| - d_{k}
 \eeq
-where $\ve{r}_k$ is the distance vector between two particles and 
-$d_k$ is the constraint distance between the two particles, we can write
-this using a $\LAM$-dependent distance as
+where $\ve{r}_k$ is the displacement vector between two particles and 
+$d_k$ is the constraint distance between the two particles. We can express
+the fact that the constraint distance has a $\LAM$ dependency by
 \beq
-g_k     =       \ve{r}_{k} - \left(\LL d_{k}^A + \LAM d_k^B\right)
+d_k     =       \LL d_{k}^A + \LAM d_k^B
 \eeq
-the contribution $\clam$ 
-to the Hamiltonian using Lagrange multipliers $\lambda$:
+
+Thus the $\LAM$-dependent constraint equation is
+\beq
+g_k     =       |\ve{r}_{k}| - \left(\LL d_{k}^A + \LAM d_k^B\right).
+\eeq
+
+The (zero) contribution $G$ to the Hamiltonian from the constraints
+(using Lagrange multipliers $\lambda_k$, which are logically distinct
+from the free-energy $\LAM$) is
 \bea
-\clam           &=&     \sum_k \lambda_k g_k    \\
-\dvdl{\clam}    &=&     \sum_k \lambda_k \left(d_k^B-d_k^A\right)
+G           &=&     \sum^K_k \lambda_k g_k    \\
+\dvdl{G}    &=&     \frac{\partial G}{\partial d_k} \dvdl{d_k} \\
+            &=&     - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
 \eea
 
+For SHAKE, the constraint equations are
+\beq
+g_k     =       \ve{r}_{k}^2 - d_{k}^2
+\eeq
+with $d_k$ as before, so
+\bea
+\dvdl{G}    &=&     -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
+\eea
 
 \subsection{Soft-core interactions\index{soft-core interactions}}
 \begin{figure}
@@ -1980,7 +1998,7 @@ used in the neighbor searching.
 For both Coulomb and van der Waals interactions there are interaction
 type selectors (termed {\tt vdwtype} and {\tt coulombtype}) and two
 parameters, for a total of six non-bonded interaction parameters. See
-\secref{mdpopt} for a complete description of these parameters.
+the User Guide for a complete description of these parameters.
 
 The neighbor searching (NS) can be performed using a single-range, or a twin-range 
 approach. Since the former is merely a special case of the latter, we will 
@@ -2942,7 +2960,7 @@ coarse-graining~\cite{wang_jpcb10}.  A {\gromacs} implementation can be found at
 % LocalWords:  fc ravdisre nstdisreout dipolar lll ccc orientational MSD const
 % LocalWords:  orire fitgrp nstorireout Drude intra Noskov et al fecalc coulrf
 % LocalWords:  polarizabilities parameterized sigeps Ek sc softcore GROMOS NBF
-% LocalWords:  hydrogens alkane vdwtype coulombtype mdpopt rlist rcoulomb rvdw
+% LocalWords:  hydrogens alkane vdwtype coulombtype rlist rcoulomb rvdw
 % LocalWords:  nstlist virial funcparm VdW jk jl fvsite fd vsites lcr vsitetop
 % LocalWords:  vsite lclllll lcl parameterize parameterization enercorr avcsix
 % LocalWords:  pcorr ecorr totalcoulomb dir fourierspacing ewald rtol Darden gz