Added reference for dihedral function in OPLS.
[gromacs.git] / docs / manual / forcefield.tex
blobcc63d51d0ad9560a3e0abd7076fd132fac7c7c2d
2 % This file is part of the GROMACS molecular simulation package.
4 % Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
5 % Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 % and including many others, as listed in the AUTHORS file in the
7 % top-level source directory and at http://www.gromacs.org.
9 % GROMACS is free software; you can redistribute it and/or
10 % modify it under the terms of the GNU Lesser General Public License
11 % as published by the Free Software Foundation; either version 2.1
12 % of the License, or (at your option) any later version.
14 % GROMACS is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 % Lesser General Public License for more details.
19 % You should have received a copy of the GNU Lesser General Public
20 % License along with GROMACS; if not, see
21 % http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 % Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 % If you want to redistribute modifications to GROMACS, please
25 % consider that scientific software is very special. Version
26 % control is crucial - bugs must be traceable. We will be happy to
27 % consider code for inclusion in the official distribution, but
28 % derived work must not be called official GROMACS. Details are found
29 % in the README & COPYING files - if they are missing, get the
30 % official version at http://www.gromacs.org.
32 % To help us fund GROMACS development, we humbly ask that you cite
33 % the research papers on the package. Check out http://www.gromacs.org.
35 \chapter{Interaction function and force fields\index{force field}}
36 \label{ch:ff}
37 To accommodate the potential functions used
38 in some popular force fields (see \ref{sec:ff}), {\gromacs} offers a choice of functions,
39 both for non-bonded interaction and for dihedral interactions. They
40 are described in the appropriate subsections.
42 The potential functions can be subdivided into three parts
43 \begin{enumerate}
44 \item {\em Non-bonded}: Lennard-Jones or Buckingham, and Coulomb or
45 modified Coulomb. The non-bonded interactions are computed on the
46 basis of a neighbor list (a list of non-bonded atoms within a certain
47 radius), in which exclusions are already removed.
48 \item {\em Bonded}: covalent bond-stretching, angle-bending,
49 improper dihedrals, and proper dihedrals. These are computed on the
50 basis of fixed lists.
51 \item {\em Restraints}: position restraints, angle restraints,
52 distance restraints, orientation restraints and dihedral restraints, all
53 based on fixed lists.
54 %\ifthenelse{\equal{\gmxlite}{1}}{}{
55 \item {\em Applied Forces}:
56 externally applied forces, see \chref{special}.
58 \end{enumerate}
60 \section{Non-bonded interactions}
61 Non-bonded interactions in {\gromacs} are pair-additive and centro-symmetric:
62 \beq
63 V(\ve{r}_1,\ldots \ve{r}_N) = \sum_{i<j}V_{ij}(\rvij);
64 \eeq
65 \beq
66 \ve{F}_i = -\sum_j \frac{dV_{ij}(r_{ij})}{dr_{ij}} \frac{\rvij}{r_{ij}} = -\ve{F}_j
67 \eeq
68 The non-bonded interactions contain a \normindex{repulsion} term,
69 a \normindex{dispersion}
70 term, and a Coulomb term. The repulsion and dispersion term are
71 combined in either the Lennard-Jones (or 6-12 interaction), or the
72 Buckingham (or exp-6 potential). In addition, (partially) charged atoms
73 act through the Coulomb term.
75 \subsection{The Lennard-Jones interaction}
76 \label{sec:lj}
77 The \normindex{Lennard-Jones} potential $V_{LJ}$ between two atoms equals:
78 \beq
79 V_{LJ}(\rij) = \frac{C_{ij}^{(12)}}{\rij^{12}} -
80 \frac{C_{ij}^{(6)}}{\rij^6}
81 \eeq
82 See also \figref{lj}
83 The parameters $C^{(12)}_{ij}$ and $C^{(6)}_{ij}$ depend on pairs of
84 {\em atom types}; consequently they are taken from a matrix of
85 LJ-parameters. In the Verlet cut-off scheme, the potential is shifted
86 by a constant such that it is zero at the cut-off distance.
88 \begin{figure}
89 \centerline{\includegraphics[width=8cm]{plots/f-lj}}
90 \caption {The Lennard-Jones interaction.}
91 \label{fig:lj}
92 \end{figure}
94 The force derived from this potential is:
95 \beq
96 \ve{F}_i(\rvij) = \left( 12~\frac{C_{ij}^{(12)}}{\rij^{13}} -
97 6~\frac{C_{ij}^{(6)}}{\rij^7} \right) \rnorm
98 \eeq
100 The LJ potential may also be written in the following form:
101 \beq
102 V_{LJ}(\rvij) = 4\epsilon_{ij}\left(\left(\frac{\sigma_{ij}} {\rij}\right)^{12}
103 - \left(\frac{\sigma_{ij}}{\rij}\right)^{6} \right)
104 \label{eqn:sigeps}
105 \eeq
107 In constructing the parameter matrix for the non-bonded LJ-parameters,
108 two types of \normindex{combination rule}s can be used within {\gromacs},
109 only geometric averages (type 1 in the input section of the force-field file):
110 \beq
111 \begin{array}{rcl}
112 C_{ij}^{(6)} &=& \left({C_{ii}^{(6)} \, C_{jj}^{(6)}}\right)^{1/2} \\
113 C_{ij}^{(12)} &=& \left({C_{ii}^{(12)} \, C_{jj}^{(12)}}\right)^{1/2}
114 \label{eqn:comb}
115 \end{array}
116 \eeq
117 or, alternatively the Lorentz-Berthelot rules can be used. An arithmetic average is used to calculate $\sigma_{ij}$, while a geometric average is used to calculate $\epsilon_{ij}$ (type 2):
118 \beq
119 \begin{array}{rcl}
120 \sigma_{ij} &=& \frac{1}{ 2}(\sigma_{ii} + \sigma_{jj}) \\
121 \epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2}
122 \label{eqn:lorentzberthelot}
123 \end{array}
124 \eeq
125 finally an geometric average for both parameters can be used (type 3):
126 \beq
127 \begin{array}{rcl}
128 \sigma_{ij} &=& \left({\sigma_{ii} \, \sigma_{jj}}\right)^{1/2} \\
129 \epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2}
130 \end{array}
131 \eeq
132 This last rule is used by the OPLS force field.
135 %\ifthenelse{\equal{\gmxlite}{1}}{}{
136 \subsection{\normindex{Buckingham potential}}
137 The Buckingham
138 potential has a more flexible and realistic repulsion term
139 than the Lennard-Jones interaction, but is also more expensive to
140 compute. The potential form is:
141 \beq
142 V_{bh}(\rij) = A_{ij} \exp(-B_{ij} \rij) -
143 \frac{C_{ij}}{\rij^6}
144 \eeq
145 \begin{figure}
146 \centerline{\includegraphics[width=8cm]{plots/f-bham}}
147 \caption {The Buckingham interaction.}
148 \label{fig:bham}
149 \end{figure}
151 See also \figref{bham}. The force derived from this is:
152 \beq
153 \ve{F}_i(\rij) = \left[ A_{ij}B_{ij}\exp(-B_{ij} \rij) -
154 6\frac{C_{ij}}{\rij^7} \right] \rnorm
155 \eeq
157 %} % Brace matches ifthenelse test for gmxlite
159 \subsection{Coulomb interaction}
160 \label{sec:coul}
161 \newcommand{\epsr}{\varepsilon_r}
162 \newcommand{\epsrf}{\varepsilon_{rf}}
163 The \normindex{Coulomb} interaction between two charge particles is given by:
164 \beq
165 V_c(\rij) = f \frac{q_i q_j}{\epsr \rij}
166 \label{eqn:vcoul}
167 \eeq
168 See also \figref{coul}, where $f = \frac{1}{4\pi \varepsilon_0} =
169 \electricConvFactorValue$ (see \chref{defunits})
171 \begin{figure}
172 \centerline{\includegraphics[width=8cm]{plots/vcrf}}
173 \caption[The Coulomb interaction with and without reaction field.]{The
174 Coulomb interaction (for particles with equal signed charge) with and
175 without reaction field. In the latter case $\epsr$ was 1, $\epsrf$ was 78,
176 and $r_c$ was 0.9 nm.
177 The dot-dashed line is the same as the dashed line, except for a constant.}
178 \label{fig:coul}
179 \end{figure}
181 The force derived from this potential is:
182 \beq
183 \ve{F}_i(\rvij) = f \frac{q_i q_j}{\epsr\rij^2}\rnorm
184 \eeq
186 A plain Coulomb interaction should only be used without cut-off or when all pairs fall within the cut-off, since there is an abrupt, large change in the force at the cut-off. In case you do want to use a cut-off, the potential can be shifted by a constant to make the potential the integral of the force. With the group cut-off scheme, this shift is only applied to non-excluded pairs. With the Verlet cut-off scheme, the shift is also applied to excluded pairs and self interactions, which makes the potential equivalent to a reaction field with $\epsrf=1$ (see below).
188 In {\gromacs} the relative \swapindex{dielectric}{constant}
189 \normindex{$\epsr$}
190 may be set in the in the input for {\tt grompp}.
192 %\ifthenelse{\equal{\gmxlite}{1}}{}{
193 \subsection{Coulomb interaction with \normindex{reaction field}}
194 \label{sec:coulrf}
195 The Coulomb interaction can be modified for homogeneous systems by
196 assuming a constant dielectric environment beyond the cut-off $r_c$
197 with a dielectric constant of {$\epsrf$}. The interaction then reads:
198 \beq
199 V_{crf} ~=~
200 f \frac{q_i q_j}{\epsr\rij}\left[1+\frac{\epsrf-\epsr}{2\epsrf+\epsr}
201 \,\frac{\rij^3}{r_c^3}\right]
202 - f\frac{q_i q_j}{\epsr r_c}\,\frac{3\epsrf}{2\epsrf+\epsr}
203 \label{eqn:vcrf}
204 \eeq
205 in which the constant expression on the right makes the potential
206 zero at the cut-off $r_c$. For charged cut-off spheres this corresponds
207 to neutralization with a homogeneous background charge.
208 We can rewrite \eqnref{vcrf} for simplicity as
209 \beq
210 V_{crf} ~=~ f \frac{q_i q_j}{\epsr}\left[\frac{1}{\rij} + k_{rf}~ \rij^2 -c_{rf}\right]
211 \eeq
212 with
213 \bea
214 k_{rf} &=& \frac{1}{r_c^3}\,\frac{\epsrf-\epsr}{(2\epsrf+\epsr)} \label{eqn:krf}\\
215 c_{rf} &=& \frac{1}{r_c}+k_{rf}\,r_c^2 ~=~ \frac{1}{r_c}\,\frac{3\epsrf}{(2\epsrf+\epsr)}
216 \label{eqn:crf}
217 \eea
218 For large $\epsrf$ the $k_{rf}$ goes to $r_c^{-3}/2$,
219 while for $\epsrf$ = $\epsr$ the correction vanishes.
220 In \figref{coul}
221 the modified interaction is plotted, and it is clear that the derivative
222 with respect to $\rij$ (= -force) goes to zero at the cut-off distance.
223 The force derived from this potential reads:
224 \beq
225 \ve{F}_i(\rvij) = f \frac{q_i q_j}{\epsr}\left[\frac{1}{\rij^2} - 2 k_{rf}\rij\right]\rnorm
226 \label{eqn:fcrf}
227 \eeq
228 The reaction-field correction should also be applied to all excluded
229 atoms pairs, including self pairs, in which case the normal Coulomb
230 term in \eqnsref{vcrf}{fcrf} is absent.
232 Tironi {\etal} have introduced a generalized reaction field in which
233 the dielectric continuum beyond the cut-off $r_c$ also has an ionic strength
234 $I$~\cite{Tironi95}. In this case we can rewrite the constants $k_{rf}$ and
235 $c_{rf}$ using the inverse Debye screening length $\kappa$:
236 \bea
237 \kappa^2 &=&
238 \frac{2 I \,F^2}{\varepsilon_0 \epsrf RT}
239 = \frac{F^2}{\varepsilon_0 \epsrf RT}\sum_{i=1}^{K} c_i z_i^2 \\
240 k_{rf} &=& \frac{1}{r_c^3}\,
241 \frac{(\epsrf-\epsr)(1 + \kappa r_c) + \half\epsrf(\kappa r_c)^2}
242 {(2\epsrf + \epsr)(1 + \kappa r_c) + \epsrf(\kappa r_c)^2}
243 \label{eqn:kgrf}\\
244 c_{rf} &=& \frac{1}{r_c}\,
245 \frac{3\epsrf(1 + \kappa r_c + \half(\kappa r_c)^2)}
246 {(2\epsrf+\epsr)(1 + \kappa r_c) + \epsrf(\kappa r_c)^2}
247 \label{eqn:cgrf}
248 \eea
249 where $F$ is Faraday's constant, $R$ is the ideal gas constant, $T$
250 the absolute temperature, $c_i$ the molar concentration for species
251 $i$ and $z_i$ the charge number of species $i$ where we have $K$
252 different species. In the limit of zero ionic strength ($\kappa=0$)
253 \eqnsref{kgrf}{cgrf} reduce to the simple forms of \eqnsref{krf}{crf}
254 respectively.
256 \subsection{Modified non-bonded interactions}
257 \label{sec:mod_nb_int}
258 In {\gromacs}, the non-bonded potentials can be
259 modified by a shift function, also called a force-switch function,
260 since it switches the force to zero at the cut-off.
261 The purpose of this is to replace the
262 truncated forces by forces that are continuous and have continuous
263 derivatives at the \normindex{cut-off} radius. With such forces the
264 time integration produces smaller errors. But note that for
265 Lennard-Jones interactions these errors are usually smaller than other errors,
266 such as integration errors at the repulsive part of the potential.
267 For Coulomb interactions we advise against using a shifted potential
268 and for use of a reaction field or a proper long-range method such as PME.
270 There is {\em no} fundamental difference between a switch function
271 (which multiplies the potential with a function) and a shift function
272 (which adds a function to the force or potential)~\cite{Spoel2006a}. The switch
273 function is a special case of the shift function, which we apply to
274 the {\em force function} $F(r)$, related to the electrostatic or
275 van der Waals force acting on particle $i$ by particle $j$ as:
276 \beq
277 \ve{F}_i = c \, F(r_{ij}) \frac{\rvij}{r_{ij}}
278 \eeq
279 For pure Coulomb or Lennard-Jones interactions
280 $F(r) = F_\alpha(r) = \alpha \, r^{-(\alpha+1)}$.
281 The switched force $F_s(r)$ can generally be written as:
282 \beq
283 \begin{array}{rcl}
284 \vspace{2mm}
285 F_s(r)~=&~F_\alpha(r) & r < r_1 \\
286 \vspace{2mm}
287 F_s(r)~=&~F_\alpha(r)+S(r) & r_1 \le r < r_c \\
288 F_s(r)~=&~0 & r_c \le r
289 \end{array}
290 \eeq
291 When $r_1=0$ this is a traditional shift function, otherwise it acts as a
292 switch function. The corresponding shifted potential function then reads:
293 \beq
294 V_s(r) = \int^{\infty}_r~F_s(x)\, dx
295 \eeq
297 The {\gromacs} {\bf force switch} function $S_F(r)$ should be smooth at the boundaries, therefore
298 the following boundary conditions are imposed on the switch function:
299 \beq
300 \begin{array}{rcl}
301 S_F(r_1) &=&0 \\
302 S_F'(r_1) &=&0 \\
303 S_F(r_c) &=&-F_\alpha(r_c) \\
304 S_F'(r_c) &=&-F_\alpha'(r_c)
305 \end{array}
306 \eeq
307 A 3$^{rd}$ degree polynomial of the form
308 \beq
309 S_F(r) = A(r-r_1)^2 + B(r-r_1)^3
310 \eeq
311 fulfills these requirements. The constants A and B are given by the
312 boundary condition at $r_c$:
313 \beq
314 \begin{array}{rcl}
315 \vspace{2mm}
316 A &~=~& -\alpha \, \displaystyle
317 \frac{(\alpha+4)r_c~-~(\alpha+1)r_1} {r_c^{\alpha+2}~(r_c-r_1)^2} \\
318 B &~=~& \alpha \, \displaystyle
319 \frac{(\alpha+3)r_c~-~(\alpha+1)r_1}{r_c^{\alpha+2}~(r_c-r_1)^3}
320 \end{array}
321 \eeq
322 Thus the total force function is:
323 \beq
324 F_s(r) = \frac{\alpha}{r^{\alpha+1}} + A(r-r_1)^2 + B(r-r_1)^3
325 \eeq
326 and the potential function reads:
327 \beq
328 V_s(r) = \frac{1}{r^\alpha} - \frac{A}{3} (r-r_1)^3 - \frac{B}{4} (r-r_1)^4 - C
329 \eeq
330 where
331 \beq
332 C = \frac{1}{r_c^\alpha} - \frac{A}{3} (r_c-r_1)^3 - \frac{B}{4} (r_c-r_1)^4
333 \eeq
335 The {\gromacs} {\bf potential-switch} function $S_V(r)$ scales the potential between
336 $r_1$ and $r_c$, and has similar boundary conditions, intended to produce
337 smoothly-varying potential and forces:
338 \beq
339 \begin{array}{rcl}
340 S_V(r_1) &=&1 \\
341 S_V'(r_1) &=&0 \\
342 S_V''(r_1) &=&0 \\
343 S_V(r_c) &=&0 \\
344 S_V'(r_c) &=&0 \\
345 S_V''(r_c) &=&0
346 \end{array}
347 \eeq
349 The fifth-degree polynomial that has these properties is
350 \beq
351 S_V(r; r_1, r_c) = \frac{1 - 10(r-r_1)^3(r_c-r_1)^2 + 15(r-r_1)^4(r_c-r_1) - 6(r-r_1)}{(r_c-r_1)^5}
352 \eeq
354 This implementation is found in several other simulation
355 packages,\cite{Ohmine1988,Kitchen1990,Guenot1993} but differs from
356 that in CHARMM.\cite{Steinbach1994} Switching the potential leads to
357 artificially large forces in the switching region, therefore it is not
358 recommended to switch Coulomb interactions using this
359 function,\cite{Spoel2006a} but switching Lennard-Jones interactions
360 using this function produces acceptable results.
362 \subsection{Modified short-range interactions with Ewald summation}
363 When Ewald summation\index{Ewald sum} or \seeindex{particle-mesh
364 Ewald}{PME}\index{Ewald, particle-mesh} is used to calculate the
365 long-range interactions, the
366 short-range Coulomb potential must also be modified. Here the potential
367 is switched to (nearly) zero at the cut-off, instead of the force.
368 In this case the short range potential is given by:
369 \beq
370 V(r) = f \frac{\mbox{erfc}(\beta r_{ij})}{r_{ij}} q_i q_j,
371 \eeq
372 where $\beta$ is a parameter that determines the relative weight
373 between the direct space sum and the reciprocal space sum and erfc$(x)$ is
374 the complementary error function. For further
375 details on long-range electrostatics, see \secref{lr_elstat}.
376 %} % Brace matches ifthenelse test for gmxlite
379 \section{Bonded interactions}
380 Bonded interactions are based on a fixed list of atoms. They are not
381 exclusively pair interactions, but include 3- and 4-body interactions
382 as well. There are {\em bond stretching} (2-body), {\em bond angle}
383 (3-body), and {\em dihedral angle} (4-body) interactions. A special
384 type of dihedral interaction (called {\em improper dihedral}) is used
385 to force atoms to remain in a plane or to prevent transition to a
386 configuration of opposite chirality (a mirror image).
388 \subsection{Bond stretching}
389 \label{sec:bondpot}
390 \subsubsection{Harmonic potential}
391 \label{subsec:harmonicbond}
392 The \swapindex{bond}{stretching} between two covalently bonded atoms
393 $i$ and $j$ is represented by a harmonic potential:
395 \begin{figure}
396 \centerline{\raisebox{2cm}{\includegraphics[width=5cm]{plots/bstretch}}\includegraphics[width=7cm]{plots/f-bond}}
397 \caption[Bond stretching.]{Principle of bond stretching (left), and the bond
398 stretching potential (right).}
399 \label{fig:bstretch1}
400 \end{figure}
402 \beq
403 V_b~(\rij) = \half k^b_{ij}(\rij-b_{ij})^2
404 \eeq
405 See also \figref{bstretch1}, with the force given by:
406 \beq
407 \ve{F}_i(\rvij) = k^b_{ij}(\rij-b_{ij}) \rnorm
408 \eeq
410 %\ifthenelse{\equal{\gmxlite}{1}}{}{
411 \subsubsection{Fourth power potential}
412 \label{subsec:G96bond}
413 In the \gromosv{96} force field~\cite{gromos96}, the covalent bond potential
414 is, for reasons of computational efficiency, written as:
415 \beq
416 V_b~(\rij) = \frac{1}{4}k^b_{ij}\left(\rij^2-b_{ij}^2\right)^2
417 \eeq
418 The corresponding force is:
419 \beq
420 \ve{F}_i(\rvij) = k^b_{ij}(\rij^2-b_{ij}^2)~\rvij
421 \eeq
422 The force constants for this form of the potential are related to the usual
423 harmonic force constant $k^{b,\mathrm{harm}}$ (\secref{bondpot}) as
424 \beq
425 2 k^b b_{ij}^2 = k^{b,\mathrm{harm}}
426 \eeq
427 The force constants are mostly derived from the harmonic ones used in
428 \gromosv{87}~\cite{biomos}. Although this form is computationally more
429 efficient
430 (because no square root has to be evaluated), it is conceptually more
431 complex. One particular disadvantage is that since the form is not harmonic,
432 the average energy of a single bond is not equal to $\half kT$ as it is for
433 the normal harmonic potential.
435 \subsection{\normindex{Morse potential} bond stretching}
436 \label{subsec:Morsebond}
437 %\author{F.P.X. Everdij}
439 For some systems that require an anharmonic bond stretching potential,
440 the Morse potential~\cite{Morse29}
441 between two atoms {\it i} and {\it j} is available
442 in {\gromacs}. This potential differs from the harmonic potential in
443 that it has an asymmetric potential well and a zero force at infinite
444 distance. The functional form is:
445 \beq
446 \displaystyle V_{morse} (r_{ij}) = D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2,
447 \eeq
448 See also \figref{morse}, and the corresponding force is:
449 \beq
450 \begin{array}{rcl}
451 \displaystyle {\bf F}_{morse} ({\bf r}_{ij})&=&2 D_{ij} \beta_{ij} \exp(-\beta_{ij}(r_{ij}-b_{ij})) * \\
452 \displaystyle \: & \: &[1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))] \frac{\displaystyle {\bf r}_{ij}}{\displaystyle r_{ij}},
453 \end{array}
454 \eeq
455 where \( \displaystyle D_{ij} \) is the depth of the well in kJ/mol,
456 \( \displaystyle \beta_{ij} \) defines the steepness of the well (in
457 nm\(^{-1} \)), and \( \displaystyle b_{ij} \) is the equilibrium
458 distance in nm. The steepness parameter \( \displaystyle \beta_{ij}
459 \) can be expressed in terms of the reduced mass of the atoms {\it i}
460 and {\it j}, the fundamental vibration frequency \( \displaystyle
461 \omega_{ij} \) and the well depth \( \displaystyle D_{ij} \):
462 \beq
463 \displaystyle \beta_{ij}= \omega_{ij} \sqrt{\frac{\mu_{ij}}{2 D_{ij}}}
464 \eeq
465 and because \( \displaystyle \omega = \sqrt{k/\mu} \), one can rewrite \( \displaystyle \beta_{ij} \) in terms of the harmonic force constant \( \displaystyle k_{ij} \):
466 \beq
467 \displaystyle \beta_{ij}= \sqrt{\frac{k_{ij}}{2 D_{ij}}}
468 \label{eqn:betaij}
469 \eeq
470 For small deviations \( \displaystyle (r_{ij}-b_{ij}) \), one can
471 approximate the \( \displaystyle \exp \)-term to first-order using a
472 Taylor expansion:
473 \beq
474 \displaystyle \exp(-x) \approx 1-x
475 \label{eqn:expminx}
476 \eeq
477 and substituting \eqnref{betaij} and \eqnref{expminx} in the functional form:
478 \beq
479 \begin{array}{rcl}
480 \displaystyle V_{morse} (r_{ij})&=&D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2\\
481 \displaystyle \:&=&D_{ij} [1 - (1 -\sqrt{\frac{k_{ij}}{2 D_{ij}}}(r_{ij}-b_{ij}))]^2\\
482 \displaystyle \:&=&\frac{1}{2} k_{ij} (r_{ij}-b_{ij}))^2
483 \end{array}
484 \eeq
485 we recover the harmonic bond stretching potential.
487 \begin{figure}
488 \centerline{\includegraphics[width=7cm]{plots/f-morse}}
489 \caption{The Morse potential well, with bond length 0.15 nm.}
490 \label{fig:morse}
491 \end{figure}
493 \subsection{Cubic bond stretching potential}
494 \label{subsec:cubicbond}
495 Another anharmonic bond stretching potential that is slightly simpler
496 than the Morse potential adds a cubic term in the distance to the
497 simple harmonic form:
498 \beq
499 V_b~(\rij) = k^b_{ij}(\rij-b_{ij})^2 + k^b_{ij}k^{cub}_{ij}(\rij-b_{ij})^3
500 \eeq
501 A flexible \normindex{water} model (based on
502 the SPC water model~\cite{Berendsen81}) including
503 a cubic bond stretching potential for the O-H bond
504 was developed by Ferguson~\cite{Ferguson95}. This model was found
505 to yield a reasonable infrared spectrum. The Ferguson water model is
506 available in the {\gromacs} library ({\tt flexwat-ferguson.itp}).
507 It should be noted that the potential is asymmetric: overstretching leads to
508 infinitely low energies. The \swapindex{integration}{timestep} is therefore
509 limited to 1 fs.
511 The force corresponding to this potential is:
512 \beq
513 \ve{F}_i(\rvij) = 2k^b_{ij}(\rij-b_{ij})~\rnorm + 3k^b_{ij}k^{cub}_{ij}(\rij-b_{ij})^2~\rnorm
514 \eeq
516 \subsection{FENE bond stretching potential\index{FENE potential}}
517 \label{subsec:FENEbond}
518 In coarse-grained polymer simulations the beads are often connected
519 by a FENE (finitely extensible nonlinear elastic) potential~\cite{Warner72}:
520 \beq
521 V_{\mbox{\small FENE}}(\rij) =
522 -\half k^b_{ij} b^2_{ij} \log\left(1 - \frac{\rij^2}{b^2_{ij}}\right)
523 \eeq
524 The potential looks complicated, but the expression for the force is simpler:
525 \beq
526 F_{\mbox{\small FENE}}(\rvij) =
527 -k^b_{ij} \left(1 - \frac{\rij^2}{b^2_{ij}}\right)^{-1} \rvij
528 \eeq
529 At short distances the potential asymptotically goes to a harmonic
530 potential with force constant $k^b$, while it diverges at distance $b$.
531 %} % Brace matches ifthenelse test for gmxlite
533 \subsection{Harmonic angle potential}
534 \label{subsec:harmonicangle}
535 \newcommand{\tijk}{\theta_{ijk}}
536 The bond-\swapindex{angle}{vibration} between a triplet of atoms $i$ - $j$ - $k$
537 is also represented by a harmonic potential on the angle $\tijk$
539 \begin{figure}
540 \centerline{\raisebox{1cm}{\includegraphics[width=5cm]{plots/angle}}\includegraphics[width=7cm]{plots/f-angle}}
541 \caption[Angle vibration.]{Principle of angle vibration (left) and the
542 bond angle potential (right).}
543 \label{fig:angle}
544 \end{figure}
546 \beq
547 V_a(\tijk) = \half k^{\theta}_{ijk}(\tijk-\tijk^0)^2
548 \eeq
549 As the bond-angle vibration is represented by a harmonic potential, the
550 form is the same as the bond stretching (\figref{bstretch1}).
552 The force equations are given by the chain rule:
553 \beq
554 \begin{array}{l}
555 \Fvi ~=~ -\displaystyle\frac{d V_a(\tijk)}{d \rvi} \\
556 \Fvk ~=~ -\displaystyle\frac{d V_a(\tijk)}{d \rvk} \\
557 \Fvj ~=~ -\Fvi-\Fvk
558 \end{array}
559 ~ \mbox{ ~ where ~ } ~
560 \tijk = \arccos \frac{(\rvij \cdot \ve{r}_{kj})}{r_{ij}r_{kj}}
561 \eeq
562 The numbering $i,j,k$ is in sequence of covalently bonded atoms. Atom
563 $j$ is in the middle; atoms $i$ and $k$ are at the ends (see \figref{angle}).
564 {\bf Note} that in the input in topology files, angles are given in degrees and
565 force constants in kJ/mol/rad$^2$.
567 %\ifthenelse{\equal{\gmxlite}{1}}{}{
568 \subsection{Cosine based angle potential}
569 \label{subsec:G96angle}
570 In the \gromosv{96} force field a simplified function is used to represent angle
571 vibrations:
572 \beq
573 V_a(\tijk) = \half k^{\theta}_{ijk}\left(\cos(\tijk) - \cos(\tijk^0)\right)^2
574 \label{eq:G96angle}
575 \eeq
576 where
577 \beq
578 \cos(\tijk) = \frac{\rvij\cdot\ve{r}_{kj}}{\rij r_{kj}}
579 \eeq
580 The corresponding force can be derived by partial differentiation with respect
581 to the atomic positions. The force constants in this function are related
582 to the force constants in the harmonic form $k^{\theta,\mathrm{harm}}$
583 (\ssecref{harmonicangle}) by:
584 \beq
585 k^{\theta} \sin^2(\tijk^0) = k^{\theta,\mathrm{harm}}
586 \eeq
587 In the \gromosv{96} manual there is a much more complicated conversion formula
588 which is temperature dependent. The formulas are equivalent at 0 K
589 and the differences at 300 K are on the order of 0.1 to 0.2\%.
590 {\bf Note} that in the input in topology files, angles are given in degrees and
591 force constants in kJ/mol.
593 \subsection{Restricted bending potential}
594 \label{subsec:ReB}
595 The restricted bending (ReB) potential~\cite{MonicaGoga2013} prevents the bending angle $\theta$
596 from reaching the $180^{\circ}$ value. In this way, the numerical instabilities
597 due to the calculation of the torsion angle and potential are eliminated when
598 performing coarse-grained molecular dynamics simulations.
600 To systematically hinder the bending angles from reaching the $180^{\circ}$ value,
601 the bending potential \ref{eq:G96angle} is divided by a $\sin^2\theta$ factor:
603 \beq
604 V_{\rm ReB}(\theta_i) = \frac{1}{2} k_{\theta} \frac{(\cos\theta_i - \cos\theta_0)^2}{\sin^2\theta_i}.
605 \label{eq:ReB}
606 \eeq
608 Figure ~\figref{ReB} shows the comparison between the ReB potential, \ref{eq:ReB},
609 and the standard one \ref{eq:G96angle}.
611 \begin{figure}
612 \centerline{\includegraphics[width=10cm]{plots/fig-02}}
613 \vspace*{8pt}
614 \caption{Bending angle potentials: cosine harmonic (solid black line), angle harmonic
615 (dashed black line) and restricted bending (red) with the same bending constant
616 $k_{\theta}=85$ kJ mol$^{-1}$ and equilibrium angle $\theta_0=130^{\circ}$.
617 The orange line represents the sum of a cosine harmonic ($k =50$ kJ mol$^{-1}$)
618 with a restricted bending ($k =25$ kJ mol$^{-1}$) potential, both with $\theta_0=130^{\circ}$.}
619 \label{fig:ReB}
620 \end{figure}
622 The wall of the ReB potential is very repulsive in the region close to $180^{\circ}$ and,
623 as a result, the bending angles are kept within a safe interval, far from instabilities.
624 The power $2$ of $\sin\theta_i$ in the denominator has been chosen to guarantee this behavior
625 and allows an elegant differentiation:
627 \beq
628 F_{\rm ReB}(\theta_i) = \frac{2k_{\theta}}{\sin^4\theta_i}(\cos\theta_i - \cos\theta_0) (1 - \cos\theta_i\cos\theta_0) \frac{\partial \cos\theta_i}{\partial \vec r_{k}}.
629 \label{eq:diff_ReB}
630 \eeq
632 Due to its construction, the restricted bending potential cannot be used for equilibrium
633 $\theta_0$ values too close to $0^{\circ}$ or $180^{\circ}$ (from experience, at least $10^{\circ}$
634 difference is recommended). It is very important that, in the starting configuration,
635 all the bending angles have to be in the safe interval to avoid initial instabilities.
636 This bending potential can be used in combination with any form of torsion potential.
637 It will always prevent three consecutive particles from becoming collinear and,
638 as a result, any torsion potential will remain free of singularities.
639 It can be also added to a standard bending potential to affect the angle around $180^{\circ}$,
640 but to keep its original form around the minimum (see the orange curve in \figref{ReB}).
643 \subsection{Urey-Bradley potential}
644 \label{subsec:Urey-Bradley}
645 The \swapindex{Urey-Bradley bond-angle}{vibration} between a triplet
646 of atoms $i$ - $j$ - $k$ is represented by a harmonic potential on the
647 angle $\tijk$ and a harmonic correction term on the distance between
648 the atoms $i$ and $k$. Although this can be easily written as a simple
649 sum of two terms, it is convenient to have it as a single entry in the
650 topology file and in the output as a separate energy term. It is used mainly
651 in the CHARMm force field~\cite{BBrooks83}. The energy is given by:
653 \beq
654 V_a(\tijk) = \half k^{\theta}_{ijk}(\tijk-\tijk^0)^2 + \half k^{UB}_{ijk}(r_{ik}-r_{ik}^0)^2
655 \eeq
657 The force equations can be deduced from sections~\ssecref{harmonicbond}
658 and~\ssecref{harmonicangle}.
660 \subsection{Bond-Bond cross term}
661 \label{subsec:bondbondcross}
662 The bond-bond cross term for three particles $i, j, k$ forming bonds
663 $i-j$ and $k-j$ is given by~\cite{Lawrence2003b}:
664 \begin{equation}
665 V_{rr'} ~=~ k_{rr'} \left(\left|\ve{r}_{i}-\ve{r}_j\right|-r_{1e}\right) \left(\left|\ve{r}_{k}-\ve{r}_j\right|-r_{2e}\right)
666 \label{crossbb}
667 \end{equation}
668 where $k_{rr'}$ is the force constant, and $r_{1e}$ and $r_{2e}$ are the
669 equilibrium bond lengths of the $i-j$ and $k-j$ bonds respectively. The force
670 associated with this potential on particle $i$ is:
671 \begin{equation}
672 \ve{F}_{i} = -k_{rr'}\left(\left|\ve{r}_{k}-\ve{r}_j\right|-r_{2e}\right)\frac{\ve{r}_i-\ve{r}_j}{\left|\ve{r}_{i}-\ve{r}_j\right|}
673 \end{equation}
674 The force on atom $k$ can be obtained by swapping $i$ and $k$ in the above
675 equation. Finally, the force on atom $j$ follows from the fact that the sum
676 of internal forces should be zero: $\ve{F}_j = -\ve{F}_i-\ve{F}_k$.
678 \subsection{Bond-Angle cross term}
679 \label{subsec:bondanglecross}
680 The bond-angle cross term for three particles $i, j, k$ forming bonds
681 $i-j$ and $k-j$ is given by~\cite{Lawrence2003b}:
682 \begin{equation}
683 V_{r\theta} ~=~ k_{r\theta} \left(\left|\ve{r}_{i}-\ve{r}_k\right|-r_{3e} \right) \left(\left|\ve{r}_{i}-\ve{r}_j\right|-r_{1e} + \left|\ve{r}_{k}-\ve{r}_j\right|-r_{2e}\right)
684 \end{equation}
685 where $k_{r\theta}$ is the force constant, $r_{3e}$ is the $i-k$ distance,
686 and the other constants are the same as in Equation~\ref{crossbb}. The force
687 associated with the potential on atom $i$ is:
688 \begin{equation}
689 \ve{F}_{i} ~=~ -k_{r\theta}\left[\left(\left|\ve{r}_{i}-\ve{r}_{k}\right|-r_{3e}\right)\frac{\ve{r}_i-\ve{r}_j}{\left|\ve{r}_{i}-\ve{r}_j\right|} \\
690 + \left(\left|\ve{r}_{i}-\ve{r}_j\right|-r_{1e} + \left|\ve{r}_{k}-\ve{r}_j\right|-r_{2e}\right)\frac{\ve{r}_i-\ve{r}_k}{\left|\ve{r}_{i}-\ve{r}_k\right|}\right]
691 \end{equation}
693 \subsection{Quartic angle potential}
694 \label{subsec:quarticangle}
695 For special purposes there is an angle potential
696 that uses a fourth order polynomial:
697 \beq
698 V_q(\tijk) ~=~ \sum_{n=0}^5 C_n (\tijk-\tijk^0)^n
699 \eeq
700 %} % Brace matches ifthenelse test for gmxlite
702 %% new commands %%%%%%%%%%%%%%%%%%%%%%
703 \newcommand{\rvkj}{{\bf r}_{kj}}
704 \newcommand{\rkj}{r_{kj}}
705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
707 \subsection{Improper dihedrals\swapindexquiet{improper}{dihedral}}
708 \label{sec:imp}
709 Improper dihedrals are meant to keep \swapindex{planar}{group}s ({\eg}
710 aromatic rings) planar, or to prevent molecules from flipping over to their
711 \normindex{mirror image}s, see \figref{imp}.
713 \begin {figure}
714 \centerline{\includegraphics[width=4cm]{plots/ring-imp}\hspace{1cm}
715 \includegraphics[width=3cm]{plots/subst-im}\hspace{1cm}\includegraphics[width=3cm]{plots/tetra-im}}
716 \caption[Improper dihedral angles.]{Principle of improper
717 dihedral angles. Out of plane bending for rings (left), substituents
718 of rings (middle), out of tetrahedral (right). The improper dihedral
719 angle $\xi$ is defined as the angle between planes (i,j,k) and (j,k,l)
720 in all cases.}
721 \label{fig:imp}
722 \end {figure}
724 \subsubsection{Improper dihedrals: harmonic type}
725 \label{subsec:harmonicimproperdihedral}
726 The simplest improper dihedral potential is a harmonic potential; it is plotted in
727 \figref{imps}.
728 \beq
729 V_{id}(\xi_{ijkl}) = \half k_{\xi}(\xi_{ijkl}-\xi_0)^2
730 \eeq
731 Since the potential is harmonic it is discontinuous,
732 but since the discontinuity is chosen at 180$^\circ$ distance from $\xi_0$
733 this will never cause problems.
734 {\bf Note} that in the input in topology files, angles are given in degrees and
735 force constants in kJ/mol/rad$^2$.
737 \begin{figure}
738 \centerline{\includegraphics[width=10cm]{plots/f-imps.pdf}}
739 \caption{Improper dihedral potential.}
740 \label{fig:imps}
741 \end{figure}
743 \subsubsection{Improper dihedrals: periodic type}
744 \label{subsec:periodicimproperdihedral}
745 This potential is identical to the periodic proper dihedral (see below).
746 There is a separate dihedral type for this (type 4) only to be able
747 to distinguish improper from proper dihedrals in the parameter section
748 and the output.
750 \subsection{Proper dihedrals\swapindexquiet{proper}{dihedral}}
751 For the normal \normindex{dihedral} interaction there is a choice of
752 either the {\gromos} periodic function or a function based on
753 expansion in powers of $\cos \phi$ (the so-called Ryckaert-Bellemans
754 potential). This choice has consequences for the inclusion of special
755 interactions between the first and the fourth atom of the dihedral
756 quadruple. With the periodic {\gromos} potential a special 1-4
757 LJ-interaction must be included; with the Ryckaert-Bellemans potential
758 {\em for alkanes} the \normindex{1-4 interaction}s must be excluded
759 from the non-bonded list. {\bf Note:} Ryckaert-Bellemans potentials
760 are also used in {\eg} the OPLS force field in combination with 1-4
761 interactions. You should therefore not modify topologies generated by
762 {\tt \normindex{pdb2gmx}} in this case.
764 \subsubsection{Proper dihedrals: periodic type}
765 \label{subsec:properdihedral}
766 Proper dihedral angles are defined according to the IUPAC/IUB
767 convention, where $\phi$ is the angle between the $ijk$ and the $jkl$
768 planes, with {\bf zero} corresponding to the {\em cis} configuration
769 ($i$ and $l$ on the same side). There are two dihedral function types
770 in {\gromacs} topology files. There is the standard type 1 which behaves
771 like any other bonded interactions. For certain force fields, type 9
772 is useful. Type 9 allows multiple potential functions to be applied
773 automatically to a single dihedral in the {\tt [ dihedral ]} section
774 when multiple parameters are defined for the same atomtypes
775 in the {\tt [ dihedraltypes ]} section.
777 \begin{figure}
778 \centerline{\raisebox{1cm}{\includegraphics[width=5cm]{plots/dih}}\includegraphics[width=7cm]{plots/f-dih}}
779 \caption[Proper dihedral angle.]{Principle of proper dihedral angle
780 (left, in {\em trans} form) and the dihedral angle potential (right).}
781 \label{fig:pdihf}
782 \end{figure}
783 \beq
784 V_d(\phi_{ijkl}) = k_{\phi}(1 + \cos(n \phi - \phi_s))
785 \eeq
787 %\ifthenelse{\equal{\gmxlite}{1}}{}{
788 \subsubsection{Proper dihedrals: Ryckaert-Bellemans function}
789 \label{subsec:RBdihedral}
790 For alkanes, the following proper dihedral potential is often used
791 (see \figref{rbdih}):
792 \beq
793 V_{rb}(\phi_{ijkl}) = \sum_{n=0}^5 C_n( \cos(\psi ))^n,
794 \eeq
795 where $\psi = \phi - 180^\circ$. \\
796 {\bf Note:} A conversion from one convention to another can be achieved by
797 multiplying every coefficient \( \displaystyle C_n \)
798 by \( \displaystyle (-1)^n \).
800 An example of constants for $C$ is given in \tabref{crb}.
802 \begin{table}
803 \centerline{
804 \begin{tabular}{|lr|lr|lr|}
805 \dline
806 $C_0$ & 9.28 & $C_2$ & -13.12 & $C_4$ & 26.24 \\
807 $C_1$ & 12.16 & $C_3$ & -3.06 & $C_5$ & -31.5 \\
808 \dline
809 \end{tabular}
811 \caption{Constants for Ryckaert-Bellemans potential (kJ mol$^{-1}$).}
812 \label{tab:crb}
813 \end{table}
815 \begin{figure}
816 \centerline{\includegraphics[width=8cm]{plots/f-rbs}}
817 \caption{Ryckaert-Bellemans dihedral potential.}
818 \label{fig:rbdih}
819 \end{figure}
821 ({\bf Note:} The use of this potential implies exclusion of LJ interactions
822 between the first and the last atom of the dihedral, and $\psi$ is defined
823 according to the ``polymer convention'' ($\psi_{trans}=0$).)
825 The RB dihedral function can also be used to include Fourier dihedrals
826 (see below):
827 \beq
828 V_{rb} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[F_1(1+\cos(\phi)) + F_2(
829 1-\cos(2\phi)) + F_3(1+\cos(3\phi)) + F_4(1-\cos(4\phi))\right]
830 \eeq
831 Because of the equalities \( \cos(2\phi) = 2\cos^2(\phi) - 1 \),
832 \( \cos(3\phi) = 4\cos^3(\phi) - 3\cos(\phi) \) and
833 \( \cos(4\phi) = 8\cos^4(\phi) - 8\cos^2(\phi) + 1 \)
834 one can translate the OPLS parameters to
835 Ryckaert-Bellemans parameters as follows:
836 \beq
837 \displaystyle
838 \begin{array}{rcl}
839 \displaystyle C_0&=&F_2 + \frac{1}{2} (F_1 + F_3)\\
840 \displaystyle C_1&=&\frac{1}{2} (- F_1 + 3 \, F_3)\\
841 \displaystyle C_2&=& -F_2 + 4 \, F_4\\
842 \displaystyle C_3&=&-2 \, F_3\\
843 \displaystyle C_4&=&-4 \, F_4\\
844 \displaystyle C_5&=&0
845 \end{array}
846 \eeq
847 with OPLS parameters in protein convention and RB parameters in
848 polymer convention (this yields a minus sign for the odd powers of
849 cos$(\phi)$).\\
850 \noindent{\bf Note:} Mind the conversion from {\bf kcal mol$^{-1}$} for
851 literature OPLS and RB parameters to {\bf kJ mol$^{-1}$} in {\gromacs}.\\
852 %} % Brace matches ifthenelse test for gmxlite
854 \subsubsection{Proper dihedrals: Fourier function}
855 \label{subsec:Fourierdihedral}
856 The OPLS potential function is given as the first three
857 ~\cite{Jorgensen1996} or four~\cite{Robertson2015a} cosine terms of a Fourier series.
858 In {\gromacs} the four term function is implemented:
859 \beq
860 V_{F} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[C_1(1+\cos(\phi)) + C_2(
861 1-\cos(2\phi)) + C_3(1+\cos(3\phi)) + C_4(1-\cos(4\phi))\right],
862 \eeq
863 %\ifthenelse{\equal{\gmxlite}{1}}{}{
864 Internally, {\gromacs}
865 uses the Ryckaert-Bellemans code
866 to compute Fourier dihedrals (see above), because this is more efficient.\\
867 \noindent{\bf Note:} Mind the conversion from {\emph kcal mol$^{-1}$} for
868 literature OPLS parameters to {\bf kJ mol$^{-1}$} in {\gromacs}.\\
870 \subsubsection{Proper dihedrals: Restricted torsion potential}
871 \label{subsec:ReT}
872 In a manner very similar to the restricted bending potential (see \ref{subsec:ReB}),
873 a restricted torsion/dihedral potential is introduced:
875 \beq
876 V_{\rm ReT}(\phi_i) = \frac{1}{2} k_{\phi} \frac{(\cos\phi_i - \cos\phi_0)^2}{\sin^2\phi_i}
877 \label{eq:ReT}
878 \eeq
880 with the advantages of being a function of $\cos\phi$ (no problems taking the derivative of $\sin\phi$)
881 and of keeping the torsion angle at only one minimum value. In this case, the factor $\sin^2\phi$ does
882 not allow the dihedral angle to move from the [$-180^{\circ}$:0] to [0:$180^{\circ}$] interval, i.e. it cannot have maxima both at $-\phi_0$ and $+\phi_0$ maxima, but only one of them.
883 For this reason, all the dihedral angles of the starting configuration should have their values in the
884 desired angles interval and the the equilibrium $\phi_0$ value should not be too close to the interval limits
885 (as for the restricted bending potential, described in \ref{subsec:ReB}, at least $10^{\circ}$ difference is recommended).
887 \subsubsection{Proper dihedrals: Combined bending-torsion potential}
888 \label{subsec:CBT}
889 When the four particles forming the dihedral angle become collinear (this situation will never happen in
890 atomistic simulations, but it can occur in coarse-grained simulations) the calculation of the
891 torsion angle and potential leads to numerical instabilities.
892 One way to avoid this is to use the restricted bending potential (see \ref{subsec:ReB})
893 that prevents the dihedral
894 from reaching the $180^{\circ}$ value.
896 Another way is to disregard any effects of the dihedral becoming ill-defined,
897 keeping the dihedral force and potential calculation continuous in entire angle range
898 by coupling the torsion potential (in a cosine form) with the bending potentials of the
899 adjacent bending angles in a unique expression:
901 \beq
902 V_{\rm CBT}(\theta_{i-1}, \theta_i, \phi_i) = k_{\phi} \sin^3\theta_{i-1} \sin^3\theta_{i} \sum_{n=0}^4 { a_n \cos^n\phi_i}.
903 \label{eq:CBT}
904 \eeq
906 This combined bending-torsion (CBT) potential has been proposed by~\cite{BulacuGiessen2005}
907 for polymer melt simulations and is extensively described in~\cite{MonicaGoga2013}.
909 This potential has two main advantages:
910 \begin{itemize}
911 \item
912 it does not only depend on the dihedral angle $\phi_i$ (between the $i-2$, $i-1$, $i$ and $i+1$ beads)
913 but also on the bending angles $\theta_{i-1}$ and $\theta_i$ defined from three adjacent beads
914 ($i-2$, $i-1$ and $i$, and $i-1$, $i$ and $i+1$, respectively).
915 The two $\sin^3\theta$ pre-factors, tentatively suggested by~\cite{ScottScheragator1966} and theoretically
916 discussed by~\cite{PaulingBond}, cancel the torsion potential and force when either of the two bending angles
917 approaches the value of $180^\circ$.
918 \item
919 its dependence on $\phi_i$ is expressed through a polynomial in $\cos\phi_i$ that avoids the singularities in
920 $\phi=0^\circ$ or $180^\circ$ in calculating the torsional force.
921 \end{itemize}
923 These two properties make the CBT potential well-behaved for MD simulations with weak constraints
924 on the bending angles or even for steered / non-equilibrium MD in which the bending and torsion angles suffer major
925 modifications.
926 When using the CBT potential, the bending potentials for the adjacent $\theta_{i-1}$ and $\theta_i$ may have any form.
927 It is also possible to leave out the two angle bending terms ($\theta_{i-1}$ and $\theta_{i}$) completely.
928 \figref{CBT} illustrates the difference between a torsion potential with and without the $\sin^{3}\theta$ factors
929 (blue and gray curves, respectively).
931 \begin{figure}
932 \centerline{\includegraphics[width=10cm]{plots/fig-04}}
933 \caption{Blue: surface plot of the combined bending-torsion potential
934 (\ref{eq:CBT} with $k = 10$ kJ mol$^{-1}$, $a_0=2.41$, $a_1=-2.95$, $a_2=0.36$, $a_3=1.33$)
935 when, for simplicity, the bending angles behave the same ($\theta_1=\theta_2=\theta$).
936 Gray: the same torsion potential without the $\sin^{3}\theta$ terms (Ryckaert-Bellemans type).
937 $\phi$ is the dihedral angle.}
938 \label{fig:CBT}
939 \end{figure}
941 Additionally, the derivative of $V_{CBT}$ with respect to the Cartesian variables is straightforward:
943 \begin{equation}
944 \frac{\partial V_{\rm CBT}(\theta_{i-1},\theta_i,\phi_i)} {\partial \vec r_{l}} = \frac{\partial V_{\rm CBT}}{\partial \theta_{i-1}} \frac{\partial \theta_{i-1}}{\partial \vec r_{l}} +
945 \frac{\partial V_{\rm CBT}}{\partial \theta_{i }} \frac{\partial \theta_{i }}{\partial \vec r_{l}} +
946 \frac{\partial V_{\rm CBT}}{\partial \phi_{i }} \frac{\partial \phi_{i }}{\partial \vec r_{l}}
947 \label{eq:force_cbt}
948 \end{equation}
950 The CBT is based on a cosine form without multiplicity, so it can only be symmetrical around $0^{\circ}$.
951 To obtain an asymmetrical dihedral angle distribution (e.g. only one maximum in [$-180^{\circ}$:$180^{\circ}$] interval),
952 a standard torsion potential such as harmonic angle or periodic cosine potentials should be used instead of a CBT potential.
953 However, these two forms have the inconveniences of the force derivation ($1/\sin\phi$) and of the alignment of beads
954 ($\theta_i$ or $\theta_{i-1} = 0^{\circ}, 180^{\circ}$).
955 Coupling such non-$\cos\phi$ potentials with $\sin^3\theta$ factors does not improve simulation stability since there are
956 cases in which $\theta$ and $\phi$ are simultaneously $180^{\circ}$. The integration at this step would be possible
957 (due to the cancelling of the torsion potential) but the next step would be singular
958 ($\theta$ is not $180^{\circ}$ and $\phi$ is very close to $180^{\circ}$).
960 %\ifthenelse{\equal{\gmxlite}{1}}{}{
961 \subsection{Tabulated bonded interaction functions\index{tabulated bonded interaction function}}
962 \label{subsec:tabulatedinteraction}
963 For full flexibility, any functional shape can be used for
964 bonds, angles and dihedrals through user-supplied tabulated functions.
965 The functional shapes are:
966 \bea
967 V_b(r_{ij}) &=& k \, f^b_n(r_{ij}) \\
968 V_a(\tijk) &=& k \, f^a_n(\tijk) \\
969 V_d(\phi_{ijkl}) &=& k \, f^d_n(\phi_{ijkl})
970 \eea
971 where $k$ is a force constant in units of energy
972 and $f$ is a cubic spline function; for details see \ssecref{cubicspline}.
973 For each interaction, the force constant $k$ and the table number $n$
974 are specified in the topology.
975 There are two different types of bonds, one that generates exclusions (type 8)
976 and one that does not (type 9).
977 For details see \tabref{topfile2}.
978 The table files are supplied to the {\tt mdrun} program.
979 After the table file name an underscore, the letter ``b'' for bonds,
980 ``a'' for angles or ``d'' for dihedrals and the table number must be appended.
981 For example, a tabulated bond with $n=0$ can be read from the file {\tt table_b0.xvg}.
982 Multiple tables can be
983 supplied simply by adding files with different values of $n$, and are applied to the appropriate
984 bonds, as specified in the topology (\tabref{topfile2}).
985 The format for the table files is three fixed-format columns of any suitable width. These columns must contain $x$, $f(x)$, $-f'(x)$,
986 and the values of $x$ should be uniformly spaced. Requirements for entries in the topology
987 are given in~\tabref{topfile2}.
988 The setup of the tables is as follows:
989 \\{\bf bonds}:
990 $x$ is the distance in nm. For distances beyond the table length,
991 {\tt mdrun} will quit with an error message.
992 \\{\bf angles}:
993 $x$ is the angle in degrees. The table should go from
994 0 up to and including 180 degrees; the derivative is taken in degrees.
995 \\{\bf dihedrals}:
996 $x$ is the dihedral angle in degrees. The table should go from
997 -180 up to and including 180 degrees;
998 the IUPAC/IUB convention is used, {\ie} zero is cis,
999 the derivative is taken in degrees.
1000 %} % Brace matches ifthenelse test for gmxlite
1002 \section{Restraints}
1003 Special potentials are used for imposing restraints on the motion of
1004 the system, either to avoid disastrous deviations, or to include
1005 knowledge from experimental data. In either case they are not really
1006 part of the force field and the reliability of the parameters is not
1007 important. The potential forms, as implemented in {\gromacs}, are
1008 mentioned just for the sake of completeness. Restraints and constraints
1009 refer to quite different algorithms in {\gromacs}.
1011 \subsection{Position restraints\swapindexquiet{position}{restraint}}
1012 \label{subsec:positionrestraint}
1013 These are used to restrain particles to fixed reference positions
1014 $\ve{R}_i$. They can be used during equilibration in order to avoid
1015 drastic rearrangements of critical parts ({\eg} to restrain motion
1016 in a protein that is subjected to large solvent forces when the
1017 solvent is not yet equilibrated). Another application is the
1018 restraining of particles in a shell around a region that is simulated
1019 in detail, while the shell is only approximated because it lacks
1020 proper interaction from missing particles outside the
1021 shell. Restraining will then maintain the integrity of the inner
1022 part. For spherical shells, it is a wise procedure to make the force
1023 constant depend on the radius, increasing from zero at the inner
1024 boundary to a large value at the outer boundary. This feature has
1025 not, however, been implemented in {\gromacs}.
1026 \newcommand{\unitv}[1]{\hat{\bf #1}}
1027 \newcommand{\halfje}[1]{\frac{#1}{2}}
1029 The following form is used:
1030 \beq
1031 V_{pr}(\ve{r}_i) = \halfje{1}k_{pr}|\rvi-\ve{R}_i|^2
1032 \eeq
1033 The potential is plotted in \figref{positionrestraint}.
1035 \begin{figure}
1036 \centerline{\includegraphics[width=8cm]{plots/f-pr}}
1037 \caption{Position restraint potential.}
1038 \label{fig:positionrestraint}
1039 \end{figure}
1041 The potential form can be rewritten without loss of generality as:
1042 \beq
1043 V_{pr}(\ve{r}_i) = \halfje{1} \left[ k_{pr}^x (x_i-X_i)^2 ~\unitv{x} + k_{pr}^y (y_i-Y_i)^2 ~\unitv{y} + k_{pr}^z (z_i-Z_i)^2 ~\unitv{z}\right]
1044 \eeq
1046 Now the forces are:
1047 \beq
1048 \begin{array}{rcl}
1049 F_i^x &=& -k_{pr}^x~(x_i - X_i) \\
1050 F_i^y &=& -k_{pr}^y~(y_i - Y_i) \\
1051 F_i^z &=& -k_{pr}^z~(z_i - Z_i)
1052 \end{array}
1053 \eeq
1054 Using three different force constants the position
1055 restraints can be turned on or off
1056 in each spatial dimension; this means that atoms can be harmonically
1057 restrained to a plane or a line.
1058 Position restraints are applied to a special fixed list of atoms. Such a
1059 list is usually generated by the {\tt \normindex{pdb2gmx}} program.
1061 \subsection{\swapindex{Flat-bottomed}{position restraint}s}
1062 \label{subsec:fbpositionrestraint}
1063 Flat-bottomed position restraints can be used to restrain particles to
1064 part of the simulation volume. No force acts on the restrained
1065 particle within the flat-bottomed region of the potential, however a
1066 harmonic force acts to move the particle to the flat-bottomed region
1067 if it is outside it. It is possible to apply normal and
1068 flat-bottomed position restraints on the same particle (however, only
1069 with the same reference position $\ve{R}_i$). The following general potential
1070 is used (Figure~\ref{fig:fbposres}A):
1071 \beq
1072 V_\mathrm{fb}(\ve{r}_i) = \frac{1}{2}k_\mathrm{fb} [d_g(\ve{r}_i;\ve{R}_i) - r_\mathrm{fb}]^2\,H[d_g(\ve{r}_i;\ve{R}_i) - r_\mathrm{fb}],
1073 \eeq
1074 where $\ve{R}_i$ is the reference position, $r_\mathrm{fb}$ is the distance
1075 from the center with a flat potential, $k_\mathrm{fb}$ the force constant, and $H$ is the Heaviside step
1076 function. The distance $d_g(\ve{r}_i;\ve{R}_i)$ from the reference
1077 position depends on the geometry $g$ of the flat-bottomed potential.
1079 \begin{figure}
1080 \centerline{\includegraphics[width=10cm]{plots/fbposres}}
1081 \caption{Flat-bottomed position restraint potential. (A) Not
1082 inverted, (B) inverted.}
1083 \label{fig:fbposres}
1084 \end{figure}
1086 The following geometries for the flat-bottomed potential are supported:\newline
1087 {\bfseries Sphere} ($g =1$): The particle is kept in a sphere of given
1088 radius. The force acts towards the center of the sphere. The following distance calculation is used:
1089 \beq
1090 d_g(\ve{r}_i;\ve{R}_i) = |\ve{r}_i-\ve{R}_i|
1091 \eeq
1092 {\bfseries Cylinder} ($g=6,7,8$): The particle is kept in a cylinder of given radius
1093 parallel to the $x$ ($g=6$), $y$ ($g=7$), or $z$-axis ($g=8$). For backwards compatibility, setting
1094 $g=2$ is mapped to $g=8$ in the code so that old {\tt .tpr} files and topologies work.
1095 The force from the flat-bottomed potential acts towards the axis of the cylinder.
1096 The component of the force parallel to the cylinder axis is zero.
1097 For a cylinder aligned along the $z$-axis:
1098 \beq
1099 d_g(\ve{r}_i;\ve{R}_i) = \sqrt{ (x_i-X_i)^2 + (y_i - Y_i)^2 }
1100 \eeq
1101 {\bfseries Layer} ($g=3,4,5$): The particle is kept in a layer defined by the
1102 thickness and the normal of the layer. The layer normal can be parallel to the $x$, $y$, or
1103 $z$-axis. The force acts parallel to the layer normal.\\
1104 \beq
1105 d_g(\ve{r}_i;\ve{R}_i) = |x_i-X_i|, \;\;\;\mbox{or}\;\;\;
1106 d_g(\ve{r}_i;\ve{R}_i) = |y_i-Y_i|, \;\;\;\mbox{or}\;\;\;
1107 d_g(\ve{r}_i;\ve{R}_i) = |z_i-Z_i|.
1108 \eeq
1110 It is possible to apply multiple independent flat-bottomed position
1111 restraints of different geometry on one particle. For example, applying
1112 a cylinder and a layer in $z$ keeps a particle within a
1113 disk. Applying three layers in $x$, $y$, and $z$ keeps the particle within a cuboid.
1115 In addition, it is possible to invert the restrained region with the
1116 unrestrained region, leading to a potential that acts to keep the particle {\it outside} of the volume
1117 defined by $\ve{R}_i$, $g$, and $r_\mathrm{fb}$. That feature is
1118 switched on by defining a negative $r_\mathrm{fb}$ in the
1119 topology. The following potential is used (Figure~\ref{fig:fbposres}B):
1120 \beq
1121 V_\mathrm{fb}^{\mathrm{inv}}(\ve{r}_i) = \frac{1}{2}k_\mathrm{fb}
1122 [d_g(\ve{r}_i;\ve{R}_i) - |r_\mathrm{fb}|]^2\,
1123 H[ -(d_g(\ve{r}_i;\ve{R}_i) - |r_\mathrm{fb}|)].
1124 \eeq
1128 %\ifthenelse{\equal{\gmxlite}{1}}{}{
1129 \subsection{Angle restraints\swapindexquiet{angle}{restraint}}
1130 \label{subsec:anglerestraint}
1131 These are used to restrain the angle between two pairs of particles
1132 or between one pair of particles and the $z$-axis.
1133 The functional form is similar to that of a proper dihedral.
1134 For two pairs of atoms:
1135 \beq
1136 V_{ar}(\ve{r}_i,\ve{r}_j,\ve{r}_k,\ve{r}_l)
1137 = k_{ar}(1 - \cos(n (\theta - \theta_0))
1139 ,~~~~\mbox{where}~~
1140 \theta = \arccos\left(\frac{\ve{r}_j -\ve{r}_i}{\|\ve{r}_j -\ve{r}_i\|}
1141 \cdot \frac{\ve{r}_l -\ve{r}_k}{\|\ve{r}_l -\ve{r}_k\|} \right)
1142 \eeq
1143 For one pair of atoms and the $z$-axis:
1144 \beq
1145 V_{ar}(\ve{r}_i,\ve{r}_j) = k_{ar}(1 - \cos(n (\theta - \theta_0))
1147 ,~~~~\mbox{where}~~
1148 \theta = \arccos\left(\frac{\ve{r}_j -\ve{r}_i}{\|\ve{r}_j -\ve{r}_i\|}
1149 \cdot \left( \begin{array}{c} 0 \\ 0 \\ 1 \\ \end{array} \right) \right)
1150 \eeq
1151 A multiplicity ($n$) of 2 is useful when you do not want to distinguish
1152 between parallel and anti-parallel vectors.
1153 The equilibrium angle $\theta$ should be between 0 and 180 degrees
1154 for multiplicity 1 and between 0 and 90 degrees for multiplicity 2.
1157 \subsection{Dihedral restraints\swapindexquiet{dihedral}{restraint}}
1158 \label{subsec:dihedralrestraint}
1159 These are used to restrain the dihedral angle $\phi$ defined by four particles
1160 as in an improper dihedral (sec.~\ref{sec:imp}) but with a slightly
1161 modified potential. Using:
1162 \beq
1163 \phi' = \left(\phi-\phi_0\right) ~{\rm MOD}~ 2\pi
1164 \label{eqn:dphi}
1165 \eeq
1166 where $\phi_0$ is the reference angle, the potential is defined as:
1167 \beq
1168 V_{dihr}(\phi') ~=~ \left\{
1169 \begin{array}{lcllll}
1170 \half k_{dihr}(\phi'-\phi_0-\Delta\phi)^2
1171 &\mbox{for}& \phi' & > & \Delta\phi \\[1.5ex]
1172 0 &\mbox{for}& \phi' & \le & \Delta\phi \\[1.5ex]
1173 \end{array}\right.
1174 \label{eqn:dihre}
1175 \eeq
1176 where $\Delta\phi$ is a user defined angle and $k_{dihr}$ is the force
1177 constant.
1178 {\bf Note} that in the input in topology files, angles are given in degrees and
1179 force constants in kJ/mol/rad$^2$.
1180 %} % Brace matches ifthenelse test for gmxlite
1182 \subsection{Distance restraints\swapindexquiet{distance}{restraint}}
1183 \label{subsec:distancerestraint}
1184 Distance restraints
1185 add a penalty to the potential when the distance between specified
1186 pairs of atoms exceeds a threshold value. They are normally used to
1187 impose experimental restraints from, for instance, experiments in nuclear
1188 magnetic resonance (NMR), on the motion of the system. Thus, MD can be
1189 used for structure refinement using NMR data\index{nmr
1190 refinement}\index{refinement,nmr}.
1191 In {\gromacs} there are three ways to impose restraints on pairs of atoms:
1192 \begin{itemize}
1193 \item Simple harmonic restraints: use {\tt [ bonds ]} type 6
1194 %\ifthenelse{\equal{\gmxlite}{1}}
1196 {(see \secref{excl}).}
1197 \item\label{subsec:harmonicrestraint}Piecewise linear/harmonic restraints: {\tt [ bonds ]} type 10.
1198 \item Complex NMR distance restraints, optionally with pair, time and/or
1199 ensemble averaging.
1200 \end{itemize}
1201 The last two options will be detailed now.
1203 The potential form for distance restraints is quadratic below a specified
1204 lower bound and between two specified upper bounds, and linear beyond the
1205 largest bound (see \figref{dist}).
1206 \beq
1207 V_{dr}(r_{ij}) ~=~ \left\{
1208 \begin{array}{lcllllll}
1209 \half k_{dr}(r_{ij}-r_0)^2
1210 &\mbox{for}& & & r_{ij} & < & r_0 \\[1.5ex]
1211 0 &\mbox{for}& r_0 & \le & r_{ij} & < & r_1 \\[1.5ex]
1212 \half k_{dr}(r_{ij}-r_1)^2
1213 &\mbox{for}& r_1 & \le & r_{ij} & < & r_2 \\[1.5ex]
1214 \half k_{dr}(r_2-r_1)(2r_{ij}-r_2-r_1)
1215 &\mbox{for}& r_2 & \le & r_{ij} & &
1216 \end{array}\right.
1217 \label{eqn:disre}
1218 \eeq
1220 \begin{figure}
1221 \centerline{\includegraphics[width=8cm]{plots/f-dr}}
1222 \caption{Distance Restraint potential.}
1223 \label{fig:dist}
1224 \end{figure}
1226 The forces are
1227 \beq
1228 \ve{F}_i~=~ \left\{
1229 \begin{array}{lcllllll}
1230 -k_{dr}(r_{ij}-r_0)\frac{\rvij}{r_{ij}}
1231 &\mbox{for}& & & r_{ij} & < & r_0 \\[1.5ex]
1232 0 &\mbox{for}& r_0 & \le & r_{ij} & < & r_1 \\[1.5ex]
1233 -k_{dr}(r_{ij}-r_1)\frac{\rvij}{r_{ij}}
1234 &\mbox{for}& r_1 & \le & r_{ij} & < & r_2 \\[1.5ex]
1235 -k_{dr}(r_2-r_1)\frac{\rvij}{r_{ij}}
1236 &\mbox{for}& r_2 & \le & r_{ij} & &
1237 \end{array} \right.
1238 \eeq
1240 For restraints not derived from NMR data, this functionality
1241 will usually suffice and a section of {\tt [ bonds ]} type 10
1242 can be used to apply individual restraints between pairs of
1243 %\ifthenelse{\equal{\gmxlite}{1}}{atoms.}{
1244 atoms, see \ssecref{topfile}.
1245 %} % Brace matches ifthenelse test for gmxlite
1246 For applying restraints derived from NMR measurements, more complex
1247 functionality might be required, which is provided through
1248 the {\tt [~distance_restraints~]} section and is described below.
1250 %\ifthenelse{\equal{\gmxlite}{1}}{}{
1251 \subsubsection{Time averaging\swapindexquiet{time-averaged}{distance restraint}}
1252 Distance restraints based on instantaneous distances can potentially reduce
1253 the fluctuations in a molecule significantly. This problem can be overcome by restraining
1254 to a {\em time averaged} distance~\cite{Torda89}.
1255 The forces with time averaging are:
1256 \beq
1257 \ve{F}_i~=~ \left\{
1258 \begin{array}{lcllllll}
1259 -k^a_{dr}(\bar{r}_{ij}-r_0)\frac{\rvij}{r_{ij}}
1260 &\mbox{for}& & & \bar{r}_{ij} & < & r_0 \\[1.5ex]
1261 0 &\mbox{for}& r_0 & \le & \bar{r}_{ij} & < & r_1 \\[1.5ex]
1262 -k^a_{dr}(\bar{r}_{ij}-r_1)\frac{\rvij}{r_{ij}}
1263 &\mbox{for}& r_1 & \le & \bar{r}_{ij} & < & r_2 \\[1.5ex]
1264 -k^a_{dr}(r_2-r_1)\frac{\rvij}{r_{ij}}
1265 &\mbox{for}& r_2 & \le & \bar{r}_{ij} & &
1266 \end{array} \right.
1267 \eeq
1268 where $\bar{r}_{ij}$ is given by an exponential running average with decay time $\tau$:
1269 \beq
1270 \bar{r}_{ij} ~=~ < r_{ij}^{-3} >^{-1/3}
1271 \label{eqn:rav}
1272 \eeq
1273 The force constant $k^a_{dr}$ is switched on slowly to compensate for
1274 the lack of history at the beginning of the simulation:
1275 \beq
1276 k^a_{dr} = k_{dr} \left(1-\exp\left(-\frac{t}{\tau}\right)\right)
1277 \eeq
1278 Because of the time averaging, we can no longer speak of a distance restraint
1279 potential.
1281 This way an atom can satisfy two incompatible distance restraints
1282 {\em on average} by moving between two positions.
1283 An example would be an amino acid side-chain that is rotating around
1284 its $\chi$ dihedral angle, thereby coming close to various other groups.
1285 Such a mobile side chain can give rise to multiple NOEs that can not be
1286 fulfilled by a single structure.
1288 The computation of the time
1289 averaged distance in the {\tt mdrun} program is done in the following fashion:
1290 \beq
1291 \begin{array}{rcl}
1292 \overline{r^{-3}}_{ij}(0) &=& r_{ij}(0)^{-3} \\
1293 \overline{r^{-3}}_{ij}(t) &=& \overline{r^{-3}}_{ij}(t-\Delta t)~\exp{\left(-\frac{\Delta t}{\tau}\right)} + r_{ij}(t)^{-3}\left[1-\exp{\left(-\frac{\Delta t}{\tau}\right)}\right]
1294 \label{eqn:ravdisre}
1295 \end{array}
1296 \eeq
1298 When a pair is within the bounds, it can still feel a force
1299 because the time averaged distance can still be beyond a bound.
1300 To prevent the protons from being pulled too close together, a mixed
1301 approach can be used. In this approach, the penalty is zero when the
1302 instantaneous distance is within the bounds, otherwise the violation is
1303 the square root of the product of the instantaneous violation and the
1304 time averaged violation:
1305 \beq
1306 \ve{F}_i~=~ \left\{
1307 \begin{array}{lclll}
1308 k^a_{dr}\sqrt{(r_{ij}-r_0)(\bar{r}_{ij}-r_0)}\frac{\rvij}{r_{ij}}
1309 & \mbox{for} & r_{ij} < r_0 & \mbox{and} & \bar{r}_{ij} < r_0 \\[1.5ex]
1310 -k^a _{dr} \,
1311 \mbox{min}\left(\sqrt{(r_{ij}-r_1)(\bar{r}_{ij}-r_1)},r_2-r_1\right)
1312 \frac{\rvij}{r_{ij}}
1313 & \mbox{for} & r_{ij} > r_1 & \mbox{and} & \bar{r}_{ij} > r_1 \\[1.5ex]
1314 0 &\mbox{otherwise}
1315 \end{array} \right.
1316 \eeq
1318 \subsubsection{Averaging over multiple pairs\swapindexquiet{ensemble-averaged}{distance restraint}}
1320 Sometimes it is unclear from experimental data which atom pair
1321 gives rise to a single NOE, in other occasions it can be obvious that
1322 more than one pair contributes due to the symmetry of the system, {\eg} a
1323 methyl group with three protons. For such a group, it is not possible
1324 to distinguish between the protons, therefore they should all be taken into
1325 account when calculating the distance between this methyl group and another
1326 proton (or group of protons).
1327 Due to the physical nature of magnetic resonance, the intensity of the
1328 NOE signal is inversely proportional to the sixth power of the inter-atomic
1329 distance.
1330 Thus, when combining atom pairs,
1331 a fixed list of $N$ restraints may be taken together,
1332 where the apparent ``distance'' is given by:
1333 \beq
1334 r_N(t) = \left [\sum_{n=1}^{N} \bar{r}_{n}(t)^{-6} \right]^{-1/6}
1335 \label{eqn:rsix}
1336 \eeq
1337 where we use $r_{ij}$ or \eqnref{rav} for the $\bar{r}_{n}$.
1338 The $r_N$ of the instantaneous and time-averaged distances
1339 can be combined to do a mixed restraining, as indicated above.
1340 As more pairs of protons contribute to the same NOE signal, the intensity
1341 will increase, and the summed ``distance'' will be shorter than any of
1342 its components due to the reciprocal summation.
1344 There are two options for distributing the forces over the atom pairs.
1345 In the conservative option, the force is defined as the derivative of the
1346 restraint potential with respect to the coordinates. This results in
1347 a conservative potential when time averaging is not used.
1348 The force distribution over the pairs is proportional to $r^{-6}$.
1349 This means that a close pair feels a much larger force than a distant pair,
1350 which might lead to a molecule that is ``too rigid.''
1351 The other option is an equal force distribution. In this case each pair
1352 feels $1/N$ of the derivative of the restraint potential with respect to
1353 $r_N$. The advantage of this method is that more conformations might be
1354 sampled, but the non-conservative nature of the forces can lead to
1355 local heating of the protons.
1357 It is also possible to use {\em ensemble averaging} using multiple
1358 (protein) molecules. In this case the bounds should be lowered as in:
1359 \beq
1360 \begin{array}{rcl}
1361 r_1 &~=~& r_1 * M^{-1/6} \\
1362 r_2 &~=~& r_2 * M^{-1/6}
1363 \end{array}
1364 \eeq
1365 where $M$ is the number of molecules. The {\gromacs} preprocessor {\tt grompp}
1366 can do this automatically when the appropriate option is given.
1367 The resulting ``distance'' is
1368 then used to calculate the scalar force according to:
1369 \beq
1370 \ve{F}_i~=~\left\{
1371 \begin{array}{rcl}
1372 ~& 0 \hspace{4cm} & r_{N} < r_1 \\
1373 & k_{dr}(r_{N}-r_1)\frac{\rvij}{r_{ij}} & r_1 \le r_{N} < r_2 \\
1374 & k_{dr}(r_2-r_1)\frac{\rvij}{r_{ij}} & r_{N} \ge r_2
1375 \end{array} \right.
1376 \eeq
1377 where $i$ and $j$ denote the atoms of all the
1378 pairs that contribute to the NOE signal.
1380 \subsubsection{Using distance restraints}
1382 A list of distance restrains based on NOE data can be added to a molecule
1383 definition in your topology file, like in the following example:
1385 \begin{verbatim}
1386 [ distance_restraints ]
1387 ; ai aj type index type' low up1 up2 fac
1388 10 16 1 0 1 0.0 0.3 0.4 1.0
1389 10 28 1 1 1 0.0 0.3 0.4 1.0
1390 10 46 1 1 1 0.0 0.3 0.4 1.0
1391 16 22 1 2 1 0.0 0.3 0.4 2.5
1392 16 34 1 3 1 0.0 0.5 0.6 1.0
1393 \end{verbatim}
1395 In this example a number of features can be found. In columns {\tt
1396 ai} and {\tt aj} you find the atom numbers of the particles to be
1397 restrained. The {\tt type} column should always be 1. As explained in
1398 ~\ssecref{distancerestraint}, multiple distances can contribute to a single NOE
1399 signal. In the topology this can be set using the {\tt index}
1400 column. In our example, the restraints 10-28 and 10-46 both have index
1401 1, therefore they are treated simultaneously. An extra requirement
1402 for treating restraints together is that the restraints must be on
1403 successive lines, without any other intervening restraint. The {\tt
1404 type'} column will usually be 1, but can be set to 2 to obtain a
1405 distance restraint that will never be time- and ensemble-averaged;
1406 this can be useful for restraining hydrogen bonds. The columns {\tt
1407 low}, {\tt up1}, and {\tt up2} hold the values of $r_0$, $r_1$, and
1408 $r_2$ from ~\eqnref{disre}. In some cases it can be useful to have
1409 different force constants for some restraints; this is controlled by
1410 the column {\tt fac}. The force constant in the parameter file is
1411 multiplied by the value in the column {\tt fac} for each restraint.
1412 %} % Brace matches ifthenelse test for gmxlite
1414 \newcommand{\SSS}{{\mathbf S}}
1415 \newcommand{\DD}{{\mathbf D}}
1416 \newcommand{\RR}{{\mathbf R}}
1418 %\ifthenelse{\equal{\gmxlite}{1}}{}{
1419 \subsection{Orientation restraints\swapindexquiet{orientation}{restraint}}
1420 \label{subsec:orientationrestraint}
1421 This section describes how orientations between vectors,
1422 as measured in certain NMR experiments, can be calculated
1423 and restrained in MD simulations.
1424 The presented refinement methodology and a comparison of results
1425 with and without time and ensemble averaging have been
1426 published~\cite{Hess2003}.
1427 \subsubsection{Theory}
1428 In an NMR experiment, orientations of vectors can be measured when a
1429 molecule does not tumble completely isotropically in the solvent.
1430 Two examples of such orientation measurements are
1431 residual \normindex{dipolar couplings}
1432 (between two nuclei) or chemical shift anisotropies.
1433 An observable for a vector $\ve{r}_i$ can be written as follows:
1434 \beq
1435 \delta_i = \frac{2}{3} \mbox{tr}(\SSS\DD_i)
1436 \eeq
1437 where $\SSS$ is the dimensionless order tensor of the molecule.
1438 The tensor $\DD_i$ is given by:
1439 \beq
1440 \label{orient_def}
1441 \DD_i = \frac{c_i}{\|\ve{r}_i\|^\alpha} \left(
1442 %\begin{array}{lll}
1443 %3 r_x r_x - \ve{r}\cdot\ve{r} & 3 r_x r_y & 3 r_x r_z \\
1444 %3 r_x r_y & 3 r_y r_y - \ve{r}\cdot\ve{r} & 3yz \\
1445 %3 r_x r_z & 3 r_y r_z & 3 r_z r_z - \ve{r}\cdot\ve{r}
1446 %\end{array} \right)
1447 \begin{array}{lll}
1448 3 x x - 1 & 3 x y & 3 x z \\
1449 3 x y & 3 y y - 1 & 3 y z \\
1450 3 x z & 3 y z & 3 z z - 1 \\
1451 \end{array} \right)
1452 \eeq
1453 \beq
1454 \mbox{with:} \quad
1455 x=\frac{r_{i,x}}{\|\ve{r}_i\|}, \quad
1456 y=\frac{r_{i,y}}{\|\ve{r}_i\|}, \quad
1457 z=\frac{r_{i,z}}{\|\ve{r}_i\|}
1458 \eeq
1459 For a dipolar coupling $\ve{r}_i$ is the vector connecting the two
1460 nuclei, $\alpha=3$ and the constant $c_i$ is given by:
1461 \beq
1462 c_i = \frac{\mu_0}{4\pi} \gamma_1^i \gamma_2^i \frac{\hbar}{4\pi}
1463 \eeq
1464 where $\gamma_1^i$ and $\gamma_2^i$ are the gyromagnetic ratios of the
1465 two nuclei.
1467 The order tensor is symmetric and has trace zero. Using a rotation matrix
1468 ${\mathbf T}$ it can be transformed into the following form:
1469 \beq
1470 {\mathbf T}^T \SSS {\mathbf T} = s \left( \begin{array}{ccc}
1471 -\frac{1}{2}(1-\eta) & 0 & 0 \\
1472 0 & -\frac{1}{2}(1+\eta) & 0 \\
1473 0 & 0 & 1
1474 \end{array} \right)
1475 \eeq
1476 where $-1 \leq s \leq 1$ and $0 \leq \eta \leq 1$.
1477 $s$ is called the order parameter and $\eta$ the asymmetry of the
1478 order tensor $\SSS$. When the molecule tumbles isotropically in the
1479 solvent, $s$ is zero, and no orientational effects can be observed
1480 because all $\delta_i$ are zero.
1482 %\newpage
1484 \subsubsection{Calculating orientations in a simulation}
1485 For reasons which are explained below, the $\DD$ matrices are calculated
1486 which respect to a reference orientation of the molecule. The orientation
1487 is defined by a rotation matrix $\RR$, which is needed to least-squares fit
1488 the current coordinates of a selected set of atoms onto
1489 a reference conformation. The reference conformation is the starting
1490 conformation of the simulation. In case of ensemble averaging, which will
1491 be treated later, the structure is taken from the first subsystem.
1492 The calculated $\DD_i^c$ matrix is given by:
1493 \begin{equation}
1494 \label{D_rot}
1495 \DD_i^c(t) = \RR(t) \DD_i(t) \RR^T(t)
1496 \end{equation}
1497 The calculated orientation for vector $i$ is given by:
1498 \beq
1499 \delta^c_i(t) = \frac{2}{3} \mbox{tr}(\SSS(t)\DD_i^c(t))
1500 \eeq
1501 The order tensor $\SSS(t)$ is usually unknown.
1502 A reasonable choice for the order tensor is the tensor
1503 which minimizes the (weighted) mean square difference between the calculated
1504 and the observed orientations:
1505 \begin{equation}
1506 \label{S_msd}
1507 MSD(t) = \left(\sum_{i=1}^N w_i\right)^{-1} \sum_{i=1}^N w_i (\delta_i^c (t) -\delta_i^{exp})^2
1508 \end{equation}
1509 To properly combine different types of measurements, the unit of $w_i$ should
1510 be such that all terms are dimensionless. This means the unit of $w_i$
1511 is the unit of $\delta_i$ to the power $-2$.
1512 {\bf Note} that scaling all $w_i$ with a constant factor does not influence
1513 the order tensor.
1515 \subsubsection{Time averaging}
1516 Since the tensors $\DD_i$ fluctuate rapidly in time, much faster than can
1517 be observed in an experiment, they should be averaged over time in the simulation.
1518 However, in a simulation the time and the number of copies of
1519 a molecule are limited. Usually one can not obtain a converged average
1520 of the $\DD_i$ tensors over all orientations of the molecule.
1521 If one assumes that the average orientations of the $\ve{r}_i$ vectors
1522 within the molecule converge much faster than the tumbling time of
1523 the molecule, the tensor can be averaged in an axis system that
1524 rotates with the molecule, as expressed by equation~(\ref{D_rot}).
1525 The time-averaged tensors are calculated
1526 using an exponentially decaying memory function:
1527 \beq
1528 \DD^a_i(t) = \frac{\displaystyle
1529 \int_{u=t_0}^t \DD^c_i(u) \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u
1530 }{\displaystyle
1531 \int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u
1533 \eeq
1534 Assuming that the order tensor $\SSS$ fluctuates slower than the
1535 $\DD_i$, the time-averaged orientation can be calculated as:
1536 \beq
1537 \delta_i^a(t) = \frac{2}{3} \mbox{tr}(\SSS(t) \DD_i^a(t))
1538 \eeq
1539 where the order tensor $\SSS(t)$ is calculated using expression~(\ref{S_msd})
1540 with $\delta_i^c(t)$ replaced by $\delta_i^a(t)$.
1542 \subsubsection{Restraining}
1543 The simulated structure can be restrained by applying a force proportional
1544 to the difference between the calculated and the experimental orientations.
1545 When no time averaging is applied, a proper potential can be defined as:
1546 \beq
1547 V = \frac{1}{2} k \sum_{i=1}^N w_i (\delta_i^c (t) -\delta_i^{exp})^2
1548 \eeq
1549 where the unit of $k$ is the unit of energy.
1550 Thus the effective force constant for restraint $i$ is $k w_i$.
1551 The forces are given by minus the gradient of $V$.
1552 The force $\ve{F}\!_i$ working on vector $\ve{r}_i$ is:
1553 \begin{eqnarray*}
1554 \ve{F}\!_i(t)
1555 & = & - \frac{\mbox{d} V}{\mbox{d}\ve{r}_i} \\
1556 & = & -k w_i (\delta_i^c (t) -\delta_i^{exp}) \frac{\mbox{d} \delta_i (t)}{\mbox{d}\ve{r}_i} \\
1557 & = & -k w_i (\delta_i^c (t) -\delta_i^{exp})
1558 \frac{2 c_i}{\|\ve{r}\|^{2+\alpha}} \left(2 \RR^T \SSS \RR \ve{r}_i - \frac{2+\alpha}{\|\ve{r}\|^2} \mbox{tr}(\RR^T \SSS \RR \ve{r}_i \ve{r}_i^T) \ve{r}_i \right)
1559 \end{eqnarray*}
1561 \subsubsection{Ensemble averaging}
1562 Ensemble averaging can be applied by simulating a system of $M$ subsystems
1563 that each contain an identical set of orientation restraints. The systems only
1564 interact via the orientation restraint potential which is defined as:
1565 \beq
1566 V = M \frac{1}{2} k \sum_{i=1}^N w_i
1567 \langle \delta_i^c (t) -\delta_i^{exp} \rangle^2
1568 \eeq
1569 The force on vector $\ve{r}_{i,m}$ in subsystem $m$ is given by:
1570 \beq
1571 \ve{F}\!_{i,m}(t) = - \frac{\mbox{d} V}{\mbox{d}\ve{r}_{i,m}} =
1572 -k w_i \langle \delta_i^c (t) -\delta_i^{exp} \rangle \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\ve{r}_{i,m}} \\
1573 \eeq
1575 \subsubsection{Time averaging}
1576 When using time averaging it is not possible to define a potential.
1577 We can still define a quantity that gives a rough idea of the energy
1578 stored in the restraints:
1579 \beq
1580 V = M \frac{1}{2} k^a \sum_{i=1}^N w_i
1581 \langle \delta_i^a (t) -\delta_i^{exp} \rangle^2
1582 \eeq
1583 The force constant $k_a$ is switched on slowly to compensate for the
1584 lack of history at times close to $t_0$. It is exactly proportional
1585 to the amount of average that has been accumulated:
1586 \beq
1587 k^a =
1588 k \, \frac{1}{\tau}\int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u
1589 \eeq
1590 What really matters is the definition of the force. It is chosen to
1591 be proportional to the square root of the product of the time-averaged
1592 and the instantaneous deviation.
1593 Using only the time-averaged deviation induces large oscillations.
1594 The force is given by:
1595 \beq
1596 \ve{F}\!_{i,m}(t) =
1597 %\left\{ \begin{array}{ll}
1598 %0 & \mbox{for} \quad \langle \delta_i^a (t) -\delta_i^{exp} \rangle \langle \delta_i (t) -\delta_i^{exp} \rangle \leq 0 \\
1599 %... & \mbox{for} \quad \langle \delta_i^a (t) -\delta_i^{exp} \rangle \langle \delta_i (t) -\delta_i^{exp} \rangle > 0
1600 %\end{array}
1601 %\right.
1602 \left\{ \begin{array}{ll}
1603 0 & \quad \mbox{for} \quad a\, b \leq 0 \\
1604 \displaystyle
1605 k^a w_i \frac{a}{|a|} \sqrt{a\, b} \, \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\ve{r}_{i,m}}
1606 & \quad \mbox{for} \quad a\, b > 0
1607 \end{array}
1608 \right.
1609 \eeq
1610 \begin{eqnarray*}
1611 a &=& \langle \delta_i^a (t) -\delta_i^{exp} \rangle \\
1612 b &=& \langle \delta_i^c (t) -\delta_i^{exp} \rangle
1613 \end{eqnarray*}
1615 \subsubsection{Using orientation restraints}
1616 Orientation restraints can be added to a molecule definition in
1617 the topology file in the section {\tt [~orientation_restraints~]}.
1618 Here we give an example section containing five N-H residual dipolar
1619 coupling restraints:
1621 \begin{verbatim}
1622 [ orientation_restraints ]
1623 ; ai aj type exp. label alpha const. obs. weight
1624 ; Hz nm^3 Hz Hz^-2
1625 31 32 1 1 3 3 6.083 -6.73 1.0
1626 43 44 1 1 4 3 6.083 -7.87 1.0
1627 55 56 1 1 5 3 6.083 -7.13 1.0
1628 65 66 1 1 6 3 6.083 -2.57 1.0
1629 73 74 1 1 7 3 6.083 -2.10 1.0
1630 \end{verbatim}
1632 The unit of the observable is Hz, but one can choose any other unit.
1633 In columns {\tt
1634 ai} and {\tt aj} you find the atom numbers of the particles to be
1635 restrained. The {\tt type} column should always be 1.
1636 The {\tt exp.} column denotes the experiment number, starting
1637 at 1. For each experiment a separate order tensor $\SSS$
1638 is optimized. The label should be a unique number larger than zero
1639 for each restraint. The {\tt alpha} column contains the power $\alpha$
1640 that is used in equation~(\ref{orient_def}) to calculate the orientation.
1641 The {\tt const.} column contains the constant $c_i$ used in the same
1642 equation. The constant should have the unit of the observable times
1643 nm$^\alpha$. The column {\tt obs.} contains the observable, in any
1644 unit you like. The last column contains the weights $w_i$; the unit
1645 should be the inverse of the square of the unit of the observable.
1647 Some parameters for orientation restraints can be specified in the
1648 {\tt grompp.mdp} file, for a study of the effect of different
1649 force constants and averaging times and ensemble averaging see~\cite{Hess2003}.
1650 %} % Brace matches ifthenelse test for gmxlite
1652 %\ifthenelse{\equal{\gmxlite}{1}}{}{
1653 \section{Polarization}
1654 Polarization can be treated by {\gromacs} by attaching
1655 \normindex{shell} (\normindex{Drude}) particles to atoms and/or
1656 virtual sites. The energy of the shell particle is then minimized at
1657 each time step in order to remain on the Born-Oppenheimer surface.
1659 \subsection{Simple polarization}
1660 This is implemented as a harmonic potential with equilibrium distance
1662 The input given in the topology file is the polarizability $\alpha$ (in
1663 {\gromacs} units) as follows:
1664 \begin{verbatim}
1665 [ polarization ]
1666 ; Atom i j type alpha
1667 1 2 1 0.001
1668 \end{verbatim}
1669 in this case the polarizability volume is 0.001 nm$^3$ (or 1
1670 {\AA$^3$}). In order to compute the harmonic force constant $k_{cs}$
1671 (where $cs$ stands for core-shell), the
1672 following is used~\cite{Maaren2001a}:
1673 \begin{equation}
1674 k_{cs} ~=~ \frac{q_s^2}{\alpha}
1675 \end{equation}
1676 where $q_s$ is the charge on the shell particle.
1678 \subsection{Anharmonic polarization}
1679 For the development of the Drude force field by Roux and McKerell~\cite{Lopes2013a}
1680 it was found
1681 that some particles can overpolarize and this was fixed by introducing
1682 a higher order term in the polarization energy:
1683 \begin{eqnarray}
1684 V_{pol} ~=& \frac{k_{cs}}{2} r_{cs}^2 & r_{cs} \le \delta \\
1685 =& \frac{k_{cs}}{2} r_{cs}^2 + k_{hyp} (r_{cs}-\delta)^4 & r_{cs} > \delta
1686 \end{eqnarray}
1687 where $\delta$ is a user-defined constant that is set to 0.02 nm for
1688 anions in the Drude force field~\cite{HYu2010}. Since this original introduction it
1689 has also been used in other atom types~\cite{Lopes2013a}.
1690 \begin{verbatim}
1691 [ polarization ]
1692 ;Atom i j type alpha (nm^3) delta khyp
1693 1 2 2 0.001786 0.02 16.736e8
1694 \end{verbatim}
1695 The above force constant $k_{hyp}$ corresponds to 4$\cdot$10$^8$
1696 kcal/mol/nm$^4$, hence the strange number.
1698 \subsection{Water polarization}
1699 A special potential for water that allows anisotropic polarization of
1700 a single shell particle~\cite{Maaren2001a}.
1702 \subsection{Thole polarization}
1703 Based on early work by \normindex{Thole}~\cite{Thole81}, Roux and
1704 coworkers have implemented potentials for molecules like
1705 ethanol~\cite{Lamoureux2003a,Lamoureux2003b,Noskov2005a}. Within such
1706 molecules, there are intra-molecular interactions between shell
1707 particles, however these must be screened because full Coulomb would
1708 be too strong. The potential between two shell particles $i$ and $j$ is:
1709 \newcommand{\rbij}{\bar{r}_{ij}}
1710 \beq
1711 V_{thole} ~=~ \frac{q_i q_j}{r_{ij}}\left[1-\left(1+\frac{\rbij}{2}\right){\rm exp}^{-\rbij}\right]
1712 \eeq
1713 {\bf Note} that there is a sign error in Equation~1 of Noskov {\em et al.}~\cite{Noskov2005a}:
1714 \beq
1715 \rbij ~=~ a\frac{r_{ij}}{(\alpha_i \alpha_j)^{1/6}}
1716 \eeq
1717 where $a$ is a magic (dimensionless) constant, usually chosen to be
1718 2.6~\cite{Noskov2005a}; $\alpha_i$ and $\alpha_j$ are the polarizabilities
1719 of the respective shell particles.
1721 %} % Brace matches ifthenelse test for gmxlite
1723 %\ifthenelse{\equal{\gmxlite}{1}}{}{
1724 \section{Free energy interactions}
1725 \label{sec:feia}
1726 \index{free energy interactions}
1727 \newcommand{\LAM}{\lambda}
1728 \newcommand{\LL}{(1-\LAM)}
1729 \newcommand{\dvdl}[1]{\frac{\partial #1}{\partial \LAM}}
1730 This section describes the $\lambda$-dependence of the potentials
1731 used for free energy calculations (see \secref{fecalc}).
1732 All common types of potentials and constraints can be
1733 interpolated smoothly from state A ($\lambda=0$) to state B
1734 ($\lambda=1$) and vice versa.
1735 All bonded interactions are interpolated by linear interpolation
1736 of the interaction parameters. Non-bonded interactions can be
1737 interpolated linearly or via soft-core interactions.
1739 Starting in {\gromacs} 4.6, $\lambda$ is a vector, allowing different
1740 components of the free energy transformation to be carried out at
1741 different rates. Coulomb, Lennard-Jones, bonded, and restraint terms
1742 can all be controlled independently, as described in the {\tt .mdp}
1743 options.
1745 \subsubsection{Harmonic potentials}
1746 The example given here is for the bond potential, which is harmonic
1747 in {\gromacs}. However, these equations apply to the angle potential
1748 and the improper dihedral potential as well.
1749 \bea
1750 V_b &=&\half\left[\LL k_b^A +
1751 \LAM k_b^B\right] \left[b - \LL b_0^A - \LAM b_0^B\right]^2 \\
1752 \dvdl{V_b}&=&\half(k_b^B-k_b^A)
1753 \left[b - \LL b_0^A + \LAM b_0^B\right]^2 +
1754 \nonumber\\
1755 & & \phantom{\half}(b_0^A-b_0^B) \left[b - \LL b_0^A -\LAM b_0^B\right]
1756 \left[\LL k_b^A + \LAM k_b^B \right]
1757 \eea
1759 \subsubsection{\gromosv{96} bonds and angles}
1760 Fourth-power bond stretching and cosine-based angle potentials
1761 are interpolated by linear interpolation of the force constant
1762 and the equilibrium position. Formulas are not given here.
1764 \subsubsection{Proper dihedrals}
1765 For the proper dihedrals, the equations are somewhat more complicated:
1766 \bea
1767 V_d &=&\left[\LL k_d^A + \LAM k_d^B \right]
1768 \left( 1+ \cos\left[n_{\phi} \phi -
1769 \LL \phi_s^A - \LAM \phi_s^B
1770 \right]\right)\\
1771 \dvdl{V_d}&=&(k_d^B-k_d^A)
1772 \left( 1+ \cos
1773 \left[
1774 n_{\phi} \phi- \LL \phi_s^A - \LAM \phi_s^B
1775 \right]
1776 \right) +
1777 \nonumber\\
1778 &&(\phi_s^B - \phi_s^A) \left[\LL k_d^A - \LAM k_d^B\right]
1779 \sin\left[ n_{\phi}\phi - \LL \phi_s^A - \LAM \phi_s^B \right]
1780 \eea
1781 {\bf Note:} that the multiplicity $n_{\phi}$ can not be parameterized
1782 because the function should remain periodic on the interval $[0,2\pi]$.
1784 \subsubsection{Tabulated bonded interactions}
1785 For tabulated bonded interactions only the force constant can interpolated:
1786 \bea
1787 V &=& (\LL k^A + \LAM k^B) \, f \\
1788 \dvdl{V} &=& (k^B - k^A) \, f
1789 \eea
1791 \subsubsection{Coulomb interaction}
1792 The \normindex{Coulomb} interaction between two particles
1793 of which the charge varies with $\LAM$ is:
1794 \bea
1795 V_c &=& \frac{f}{\epsrf \rij}\left[\LL q_i^A q_j^A + \LAM\, q_i^B q_j^B\right] \\
1796 \dvdl{V_c}&=& \frac{f}{\epsrf \rij}\left[- q_i^A q_j^A + q_i^B q_j^B\right]
1797 \eea
1798 where $f = \frac{1}{4\pi \varepsilon_0} = \electricConvFactorValue$ (see \chref{defunits}).
1800 \subsubsection{Coulomb interaction with \normindex{reaction field}}
1801 The Coulomb interaction including a reaction field, between two particles
1802 of which the charge varies with $\LAM$ is:
1803 \bea
1804 V_c &=& f\left[\frac{1}{\rij} + k_{rf}~ \rij^2 -c_{rf}\right]
1805 \left[\LL q_i^A q_j^A + \LAM\, q_i^B q_j^B\right] \\
1806 \dvdl{V_c}&=& f\left[\frac{1}{\rij} + k_{rf}~ \rij^2 -c_{rf}\right]
1807 \left[- q_i^A q_j^A + q_i^B q_j^B\right]
1808 \label{eq:dVcoulombdlambda}
1809 \eea
1810 {\bf Note} that the constants $k_{rf}$ and $c_{rf}$ are
1811 defined using the dielectric
1812 constant $\epsrf$ of the medium (see \secref{coulrf}).
1814 \subsubsection{Lennard-Jones interaction}
1815 For the \normindex{Lennard-Jones} interaction between two particles
1816 of which the {\em atom type} varies with $\LAM$ we can write:
1817 \bea
1818 V_{LJ} &=& \frac{\LL C_{12}^A + \LAM\, C_{12}^B}{\rij^{12}} -
1819 \frac{\LL C_6^A + \LAM\, C_6^B}{\rij^6} \\
1820 \dvdl{V_{LJ}}&=&\frac{C_{12}^B - C_{12}^A}{\rij^{12}} -
1821 \frac{C_6^B - C_6^A}{\rij^6}
1822 \label{eq:dVljdlambda}
1823 \eea
1824 It should be noted that it is also possible to express a pathway from
1825 state A to state B using $\sigma$ and $\epsilon$ (see \eqnref{sigeps}).
1826 It may seem to make sense physically to vary the force field parameters
1827 $\sigma$ and $\epsilon$ rather
1828 than the derived parameters $C_{12}$ and $C_{6}$.
1829 However, the difference between the pathways in parameter space
1830 is not large, and the free energy itself
1831 does not depend on the pathway, so we use the simple formulation
1832 presented above.
1834 \subsubsection{Kinetic Energy}
1835 When the mass of a particle changes, there is also a contribution of
1836 the kinetic energy to the free energy (note that we can not write
1837 the momentum \ve{p} as m\ve{v}, since that would result
1838 in the sign of $\dvdl{E_k}$ being incorrect~\cite{Gunsteren98a}):
1840 \bea
1841 E_k &=& \half\frac{\ve{p}^2}{\LL m^A + \LAM m^B} \\
1842 \dvdl{E_k}&=& -\half\frac{\ve{p}^2(m^B-m^A)}{(\LL m^A + \LAM m^B)^2}
1843 \eea
1844 after taking the derivative, we {\em can} insert \ve{p} = m\ve{v}, such that:
1845 \beq
1846 \dvdl{E_k}~=~ -\half\ve{v}^2(m^B-m^A)
1847 \eeq
1849 \subsubsection{Constraints}
1850 \label{subsubsec:constraints}
1851 The constraints are formally part of the Hamiltonian, and therefore
1852 they give a contribution to the free energy. In {\gromacs} this can be
1853 calculated using the \normindex{LINCS} or the \normindex{SHAKE} algorithm.
1854 If we have $k = 1 \ldots K$ constraint equations $g_k$ for LINCS, then
1855 \beq
1856 g_k = |\ve{r}_{k}| - d_{k}
1857 \eeq
1858 where $\ve{r}_k$ is the displacement vector between two particles and
1859 $d_k$ is the constraint distance between the two particles. We can express
1860 the fact that the constraint distance has a $\LAM$ dependency by
1861 \beq
1862 d_k = \LL d_{k}^A + \LAM d_k^B
1863 \eeq
1865 Thus the $\LAM$-dependent constraint equation is
1866 \beq
1867 g_k = |\ve{r}_{k}| - \left(\LL d_{k}^A + \LAM d_k^B\right).
1868 \eeq
1870 The (zero) contribution $G$ to the Hamiltonian from the constraints
1871 (using Lagrange multipliers $\lambda_k$, which are logically distinct
1872 from the free-energy $\LAM$) is
1873 \bea
1874 G &=& \sum^K_k \lambda_k g_k \\
1875 \dvdl{G} &=& \frac{\partial G}{\partial d_k} \dvdl{d_k} \\
1876 &=& - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
1877 \eea
1879 For SHAKE, the constraint equations are
1880 \beq
1881 g_k = \ve{r}_{k}^2 - d_{k}^2
1882 \eeq
1883 with $d_k$ as before, so
1884 \bea
1885 \dvdl{G} &=& -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)
1886 \eea
1888 \subsection{Soft-core interactions\index{soft-core interactions}}
1889 \begin{figure}
1890 \centerline{\includegraphics[height=6cm]{plots/softcore}}
1891 \caption{Soft-core interactions at $\LAM=0.5$, with $p=2$ and
1892 $C_6^A=C_{12}^A=C_6^B=C_{12}^B=1$.}
1893 \label{fig:softcore}
1894 \end{figure}
1895 In a free-energy calculation where particles grow out of nothing, or
1896 particles disappear, using the the simple linear interpolation of the
1897 Lennard-Jones and Coulomb potentials as described in Equations~\ref{eq:dVljdlambda}
1898 and \ref{eq:dVcoulombdlambda} may lead to poor convergence. When the particles have nearly disappeared, or are close to appearing (at $\LAM$ close to 0 or 1), the interaction energy will be weak enough for particles to get very
1899 close to each other, leading to large fluctuations in the measured values of
1900 $\partial V/\partial \LAM$ (which, because of the simple linear
1901 interpolation, depends on the potentials at both the endpoints of $\LAM$).
1903 To circumvent these problems, the singularities in the potentials need to be removed. This can be done by modifying the regular Lennard-Jones and Coulomb potentials with ``soft-core'' potentials that limit the energies and forces
1904 involved at $\LAM$ values between 0 and 1, but not \emph{at} $\LAM=0$
1905 or 1.
1907 In {\gromacs} the soft-core potentials $V_{sc}$ are shifted versions of the
1908 regular potentials, so that the singularity in the potential and its
1909 derivatives at $r=0$ is never reached:
1910 \bea
1911 V_{sc}(r) &=& \LL V^A(r_A) + \LAM V^B(r_B)
1913 r_A &=& \left(\alpha \sigma_A^6 \LAM^p + r^6 \right)^\frac{1}{6}
1915 r_B &=& \left(\alpha \sigma_B^6 \LL^p + r^6 \right)^\frac{1}{6}
1916 \eea
1917 where $V^A$ and $V^B$ are the normal ``hard core'' Van der Waals or
1918 electrostatic potentials in state A ($\LAM=0$) and state B ($\LAM=1$)
1919 respectively, $\alpha$ is the soft-core parameter (set with {\tt sc_alpha}
1920 in the {\tt .mdp} file), $p$ is the soft-core $\LAM$ power (set with
1921 {\tt sc_power}), $\sigma$ is the radius of the interaction, which is
1922 $(C_{12}/C_6)^{1/6}$ or an input parameter ({\tt sc_sigma}) when $C_6$
1923 or $C_{12}$ is zero.
1925 For intermediate $\LAM$, $r_A$ and $r_B$ alter the interactions very little
1926 for $r > \alpha^{1/6} \sigma$ and quickly switch the soft-core
1927 interaction to an almost constant value for smaller $r$ (\figref{softcore}).
1928 The force is:
1929 \beq
1930 F_{sc}(r) = -\frac{\partial V_{sc}(r)}{\partial r} =
1931 \LL F^A(r_A) \left(\frac{r}{r_A}\right)^5 +
1932 \LAM F^B(r_B) \left(\frac{r}{r_B}\right)^5
1933 \eeq
1934 where $F^A$ and $F^B$ are the ``hard core'' forces.
1935 The contribution to the derivative of the free energy is:
1936 \bea
1937 \dvdl{V_{sc}(r)} & = &
1938 V^B(r_B) -V^A(r_A) +
1939 \LL \frac{\partial V^A(r_A)}{\partial r_A}
1940 \frac{\partial r_A}{\partial \LAM} +
1941 \LAM\frac{\partial V^B(r_B)}{\partial r_B}
1942 \frac{\partial r_B}{\partial \LAM}
1943 \nonumber\\
1945 V^B(r_B) -V^A(r_A) + \nonumber \\
1947 \frac{p \alpha}{6}
1948 \left[ \LAM F^B(r_B) r^{-5}_B \sigma_B^6 \LL^{p-1} -
1949 \LL F^A(r_A) r^{-5}_A \sigma_A^6 \LAM^{p-1} \right]
1950 \eea
1952 The original GROMOS Lennard-Jones soft-core function~\cite{Beutler94}
1953 uses $p=2$, but $p=1$ gives a smoother $\partial H/\partial\LAM$ curve.
1954 %When the changes between the two states involve both the disappearing
1955 %and appearing of atoms, it is important that the overlapping of atoms
1956 %happens around $\LAM=0.5$. This can usually be achieved with
1957 %$\alpha$$\approx0.7$ for $p=1$ and $\alpha$$\approx1.5$ for $p=2$.
1958 %MRS: this is now eliminated as of 4.6, since changes between atoms are done linearly.
1960 Another issue that should be considered is the soft-core effect of hydrogens
1961 without Lennard-Jones interaction. Their soft-core $\sigma$ is
1962 set with {\tt sc-sigma} in the {\tt .mdp} file. These hydrogens
1963 produce peaks in $\partial H/\partial\LAM$ at $\LAM$ is 0 and/or 1 for $p=1$
1964 and close to 0 and/or 1 with $p=2$. Lowering {\tt\mbox{sc-sigma}} will decrease
1965 this effect, but it will also increase the interactions with hydrogens
1966 relative to the other interactions in the soft-core state.
1968 When soft-core potentials are selected (by setting {\tt sc-alpha} \textgreater
1969 0), and the Coulomb and Lennard-Jones potentials are turned on or off
1970 sequentially, then the Coulombic interaction is turned off linearly,
1971 rather than using soft-core interactions, which should be less
1972 statistically noisy in most cases. This behavior can be overwritten
1973 by using the mdp option {\tt sc-coul} to {\tt yes}. Note that the {\tt sc-coul}
1974 is only taken into account when lambda states are used, not with
1975 {\tt couple-lambda0}~/ {\tt couple-lambda1}, and you can still turn off soft-core
1976 interactions by setting {\tt sc-alpha=0}. Additionally, the soft-core
1977 interaction potential is only applied when either the A or B
1978 state has zero interaction potential. If both A and B states have
1979 nonzero interaction potential, default linear scaling described above
1980 is used. When both Coulombic and Lennard-Jones interactions are turned
1981 off simultaneously, a soft-core potential is used, and a hydrogen is
1982 being introduced or deleted, the sigma is set to {\tt sc-sigma-min},
1983 which itself defaults to {\tt sc-sigma-default}.
1985 Recently, a new formulation of the soft-core approach has been derived
1986 that in most cases gives lower and more even statistical variance than
1987 the standard soft-core path described above.~\cite{Pham2011,Pham2012}
1988 Specifically, we have:
1989 \bea
1990 V_{sc}(r) &=& \LL V^A(r_A) + \LAM V^B(r_B)
1992 r_A &=& \left(\alpha \sigma_A^{48} \LAM^p + r^{48} \right)^\frac{1}{48}
1994 r_B &=& \left(\alpha \sigma_B^{48} \LL^p + r^{48} \right)^\frac{1}{48}
1995 \eea
1996 This ``1-1-48'' path is also implemented in {\gromacs}. Note that for this path the soft core $\alpha$
1997 should satisfy $0.001 < \alpha < 0.003$, rather than $\alpha \approx
1998 0.5$.
2000 %} % Brace matches ifthenelse test for gmxlite
2002 %\ifthenelse{\equal{\gmxlite}{1}}{}{
2003 \section{Methods}
2004 \subsection{Exclusions and 1-4 Interactions.}
2005 Atoms within a molecule that are close by in the chain,
2006 {\ie} atoms that are covalently bonded, or linked by one or two
2007 atoms are called {\em first neighbors, second neighbors} and
2008 {\em \swapindex{third}{neighbor}s}, respectively (see \figref{chain}).
2009 Since the interactions of atom {\bf i} with atoms {\bf i+1} and {\bf i+2}
2010 are mainly quantum mechanical, they can not be modeled by a Lennard-Jones potential.
2011 Instead it is assumed that these interactions are adequately modeled
2012 by a harmonic bond term or constraint ({\bf i, i+1}) and a harmonic angle term
2013 ({\bf i, i+2}). The first and second neighbors (atoms {\bf i+1} and {\bf i+2})
2014 are therefore
2015 {\em excluded} from the Lennard-Jones \swapindex{interaction}{list}
2016 of atom {\bf i};
2017 atoms {\bf i+1} and {\bf i+2} are called {\em \normindex{exclusions}} of atom {\bf i}.
2019 \begin{figure}
2020 \centerline{\includegraphics[width=8cm]{plots/chain}}
2021 \caption{Atoms along an alkane chain.}
2022 \label{fig:chain}
2023 \end{figure}
2025 For third neighbors, the normal Lennard-Jones repulsion is sometimes
2026 still too strong, which means that when applied to a molecule, the
2027 molecule would deform or break due to the internal strain. This is
2028 especially the case for carbon-carbon interactions in a {\em
2029 cis}-conformation ({\eg} {\em cis}-butane). Therefore, for some of these
2030 interactions, the Lennard-Jones repulsion has been reduced in the
2031 {\gromos} force field, which is implemented by keeping a separate list of
2032 1-4 and normal Lennard-Jones parameters. In other force fields, such
2033 as OPLS~\cite{Jorgensen88}, the standard Lennard-Jones parameters are reduced
2034 by a factor of two, but in that case also the dispersion (r$^{-6}$)
2035 and the Coulomb interaction are scaled.
2036 {\gromacs} can use either of these methods.
2038 \subsection{Charge Groups\index{charge group}}
2039 \label{sec:cg}
2040 In principle, the force calculation in MD is an $O(N^2)$ problem.
2041 Therefore, we apply a \normindex{cut-off} for non-bonded force (NBF)
2042 calculations; only the particles within a certain distance of each
2043 other are interacting. This reduces the cost to $O(N)$ (typically
2044 $100N$ to $200N$) of the NBF. It also introduces an error, which is,
2045 in most cases, acceptable, except when applying the cut-off implies
2046 the creation of charges, in which case you should consider using the
2047 lattice sum methods provided by {\gromacs}.
2049 Consider a water molecule interacting with another atom. If we would apply
2050 a plain cut-off on an atom-atom basis we might include the atom-oxygen
2051 interaction (with a charge of $-0.82$) without the compensating charge
2052 of the protons, and as a result, induce a large dipole moment over the system.
2053 Therefore, we have to keep groups of atoms with total charge
2054 0 together. These groups are called {\em charge groups}. Note that with
2055 a proper treatment of long-range electrostatics (e.g. particle-mesh Ewald
2056 (\secref{pme}), keeping charge groups together is not required.
2058 \subsection{Treatment of Cut-offs in the group scheme\index{cut-off}}
2059 \newcommand{\rs}{$r_{short}$}
2060 \newcommand{\rl}{$r_{long}$}
2061 {\gromacs} is quite flexible in treating cut-offs, which implies
2062 there can be quite a number of parameters to set. These parameters are
2063 set in the input file for {\tt grompp}. There are two sort of parameters
2064 that affect the cut-off interactions; you can select which type
2065 of interaction to use in each case, and which cut-offs should be
2066 used in the neighbor searching.
2068 For both Coulomb and van der Waals interactions there are interaction
2069 type selectors (termed {\tt vdwtype} and {\tt coulombtype}) and two
2070 parameters, for a total of six non-bonded interaction parameters. See
2071 the User Guide for a complete description of these parameters.
2073 In the group cut-off scheme, all of the interaction functions in \tabref{funcparm}
2074 require that neighbor searching be done with a radius at least as large as the $r_c$
2075 specified for the functional form, because of the use of charge groups.
2076 The extra radius is typically of the order of 0.25 nm (roughly the
2077 largest distance between two atoms in a charge group plus the distance a
2078 charge group can diffuse within neighbor list updates).
2080 \begin{table}[ht]
2081 \centering
2082 \begin{tabular}{|ll|l|}
2083 \dline
2084 \multicolumn{2}{|c|}{Type} & Parameters \\
2085 \hline
2086 Coulomb&Plain cut-off & $r_c$, $\epsr$ \\
2087 &Reaction field & $r_c$, $\epsrf$ \\
2088 &Shift function & $r_1$, $r_c$, $\epsr$ \\
2089 &Switch function & $r_1$, $r_c$, $\epsr$ \\
2090 \hline
2091 VdW&Plain cut-off & $r_c$ \\
2092 &Shift function & $r_1$, $r_c$ \\
2093 &Switch function & $r_1$, $r_c$ \\
2094 \dline
2095 \end{tabular}
2096 \caption[Parameters for the different functional forms of the
2097 non-bonded interactions.]{Parameters for the different functional
2098 forms of the non-bonded interactions.}
2099 \label{tab:funcparm}
2100 \end{table}
2101 %} % Brace matches ifthenelse test for gmxlite
2104 \newcommand{\vvis}{\ve{r}_s}
2105 \newcommand{\Fi}{\ve{F}_i'}
2106 \newcommand{\Fj}{\ve{F}_j'}
2107 \newcommand{\Fk}{\ve{F}_k'}
2108 \newcommand{\Fl}{\ve{F}_l'}
2109 \newcommand{\Fvis}{\ve{F}_{s}}
2110 \newcommand{\rvik}{\ve{r}_{ik}}
2111 \newcommand{\rvis}{\ve{r}_{is}}
2112 \newcommand{\rvjk}{\ve{r}_{jk}}
2113 \newcommand{\rvjl}{\ve{r}_{jl}}
2115 %\ifthenelse{\equal{\gmxlite}{1}}{}{
2116 \section{Virtual interaction sites\index{virtual interaction sites}}
2117 \label{sec:virtual_sites}
2118 Virtual interaction sites (called \seeindex{dummy atoms}{virtual interaction sites} in {\gromacs} versions before 3.3)
2119 can be used in {\gromacs} in a number of ways.
2120 We write the position of the virtual site $\ve{r}_s$ as a function of
2121 the positions of other particles \ve{r}$_i$: $\ve{r}_s =
2122 f(\ve{r}_1..\ve{r}_n)$. The virtual site, which may carry charge or be
2123 involved in other interactions, can now be used in the force
2124 calculation. The force acting on the virtual site must be
2125 redistributed over the particles with mass in a consistent way.
2126 A good way to do this can be found in ref.~\cite{Berendsen84b}.
2127 We can write the potential energy as:
2128 \beq
2129 V = V(\vvis,\ve{r}_1,\ldots,\ve{r}_n) = V^*(\ve{r}_1,\ldots,\ve{r}_n)
2130 \eeq
2131 The force on the particle $i$ is then:
2132 \beq
2133 \ve{F}_i = -\frac{\partial V^*}{\partial \ve{r}_i}
2134 = -\frac{\partial V}{\partial \ve{r}_i} -
2135 \frac{\partial V}{\partial \vvis}
2136 \frac{\partial \vvis}{\partial \ve{r}_i}
2137 = \ve{F}_i^{direct} + \Fi
2138 \eeq
2139 The first term is the normal force.
2140 The second term is the force on particle $i$ due to the virtual site, which
2141 can be written in tensor notation:
2142 \newcommand{\partd}[2]{\displaystyle\frac{\partial #1}{\partial #2_i}}
2143 \beq
2144 \Fi = \left[\begin{array}{ccc}
2145 \partd{x_s}{x} & \partd{y_s}{x} & \partd{z_s}{x} \\[1ex]
2146 \partd{x_s}{y} & \partd{y_s}{y} & \partd{z_s}{y} \\[1ex]
2147 \partd{x_s}{z} & \partd{y_s}{z} & \partd{z_s}{z}
2148 \end{array}\right]\Fvis
2149 \label{eqn:fvsite}
2150 \eeq
2151 where $\Fvis$ is the force on the virtual site and $x_s$, $y_s$ and
2152 $z_s$ are the coordinates of the virtual site. In this way, the total
2153 force and the total torque are conserved~\cite{Berendsen84b}.
2155 The computation of the \normindex{virial}
2156 (\eqnref{Xi}) is non-trivial when virtual sites are used. Since the
2157 virial involves a summation over all the atoms (rather than virtual
2158 sites), the forces must be redistributed from the virtual sites to the
2159 atoms (using ~\eqnref{fvsite}) {\em before} computation of the
2160 virial. In some special cases where the forces on the atoms can be
2161 written as a linear combination of the forces on the virtual sites (types 2
2162 and 3 below) there is no difference between computing the virial
2163 before and after the redistribution of forces. However, in the
2164 general case redistribution should be done first.
2166 \begin{figure}
2167 \centerline{\includegraphics[width=15cm]{plots/dummies}}
2168 \caption[Virtual site construction.]{The six different types of virtual
2169 site construction in \protect{\gromacs}. The constructing atoms are
2170 shown as black circles, the virtual sites in gray.}
2171 \label{fig:vsites}
2172 \end{figure}
2174 There are six ways to construct virtual sites from surrounding atoms in
2175 {\gromacs}, which we classify by the number of constructing
2176 atoms. {\bf Note} that all site types mentioned can be constructed from
2177 types 3fd (normalized, in-plane) and 3out (non-normalized, out of
2178 plane). However, the amount of computation involved increases sharply
2179 along this list, so we strongly recommended using the first adequate
2180 virtual site type that will be sufficient for a certain purpose.
2181 \figref{vsites} depicts 6 of the available virtual site constructions.
2182 The conceptually simplest construction types are linear combinations:
2183 \beq
2184 \vvis = \sum_{i=1}^N w_i \, \ve{r}_i
2185 \eeq
2186 The force is then redistributed using the same weights:
2187 \beq
2188 \Fi = w_i \, \Fvis
2189 \eeq
2191 The types of virtual sites supported in {\gromacs} are given in the list below.
2192 Constructing atoms in virtual sites can be virtual sites themselves, but
2193 only if they are higher in the list, i.e. virtual sites can be
2194 constructed from ``particles'' that are simpler virtual sites.
2195 \begin{itemize}
2196 \item[{\bf\sf 2.}]\label{subsec:vsite2}As a linear combination of two atoms
2197 (\figref{vsites} 2):
2198 \beq
2199 w_i = 1 - a ~,~~ w_j = a
2200 \eeq
2201 In this case the virtual site is on the line through atoms $i$ and
2202 $j$.
2204 \item[{\bf\sf 3.}]\label{subsec:vsite3}As a linear combination of three atoms
2205 (\figref{vsites} 3):
2206 \beq
2207 w_i = 1 - a - b ~,~~ w_j = a ~,~~ w_k = b
2208 \eeq
2209 In this case the virtual site is in the plane of the other three
2210 particles.
2212 \item[{\bf\sf 3fd.}]\label{subsec:vsite3fd}In the plane of three atoms, with a fixed distance
2213 (\figref{vsites} 3fd):
2214 \beq
2215 \vvis ~=~ \ve{r}_i + b \frac{ \rvij + a \rvjk }
2216 {| \rvij + a \rvjk |}
2217 \eeq
2218 In this case the virtual site is in the plane of the other three
2219 particles at a distance of $|b|$ from $i$.
2220 The force on particles $i$, $j$ and $k$ due to the force on the virtual
2221 site can be computed as:
2222 \beq
2223 \begin{array}{lcr}
2224 \Fi &=& \displaystyle \Fvis - \gamma ( \Fvis - \ve{p} ) \\[1ex]
2225 \Fj &=& \displaystyle (1-a)\gamma (\Fvis - \ve{p}) \\[1ex]
2226 \Fk &=& \displaystyle a \gamma (\Fvis - \ve{p}) \\
2227 \end{array}
2228 ~\mbox{~ where~ }~
2229 \begin{array}{c}
2230 \displaystyle \gamma = \frac{b}{| \rvij + a \rvjk |} \\[2ex]
2231 \displaystyle \ve{p} = \frac{ \rvis \cdot \Fvis }
2232 { \rvis \cdot \rvis } \rvis
2233 \end{array}
2234 \eeq
2236 \item[{\bf\sf 3fad.}]\label{subsec:vsite3fad}In the plane of three atoms, with a fixed angle and
2237 distance (\figref{vsites} 3fad):
2238 \beq
2239 \label{eqn:vsite2fad-F}
2240 \vvis ~=~ \ve{r}_i +
2241 d \cos \theta \frac{\rvij}{|\rvij|} +
2242 d \sin \theta \frac{\ve{r}_\perp}{|\ve{r}_\perp|}
2243 ~\mbox{~ where~ }~
2244 \ve{r}_\perp ~=~ \rvjk -
2245 \frac{ \rvij \cdot \rvjk }
2246 { \rvij \cdot \rvij }
2247 \rvij
2248 \eeq
2249 In this case the virtual site is in the plane of the other three
2250 particles at a distance of $|d|$ from $i$ at an angle of
2251 $\alpha$ with $\rvij$. Atom $k$ defines the plane and the
2252 direction of the angle. {\bf Note} that in this case $b$ and
2253 $\alpha$ must be specified, instead of $a$ and $b$ (see also
2254 \secref{vsitetop}). The force on particles $i$, $j$ and $k$
2255 due to the force on the virtual site can be computed as (with
2256 $\ve{r}_\perp$ as defined in \eqnref{vsite2fad-F}):
2257 \newcommand{\dfrac}{\displaystyle\frac}
2258 \beq
2259 \begin{array}{c}
2260 \begin{array}{lclllll}
2261 \Fi &=& \Fvis &-&
2262 \dfrac{d \cos \theta}{|\rvij|} \ve{F}_1 &+&
2263 \dfrac{d \sin \theta}{|\ve{r}_\perp|} \left(
2264 \dfrac{ \rvij \cdot \rvjk }
2265 { \rvij \cdot \rvij } \ve{F}_2 +
2266 \ve{F}_3 \right) \\[3ex]
2267 \Fj &=& &&
2268 \dfrac{d \cos \theta}{|\rvij|} \ve{F}_1 &-&
2269 \dfrac{d \sin \theta}{|\ve{r}_\perp|} \left(
2270 \ve{F}_2 +
2271 \dfrac{ \rvij \cdot \rvjk }
2272 { \rvij \cdot \rvij } \ve{F}_2 +
2273 \ve{F}_3 \right) \\[3ex]
2274 \Fk &=& && &&
2275 \dfrac{d \sin \theta}{|\ve{r}_\perp|} \ve{F}_2 \\[3ex]
2276 \end{array} \\[5ex]
2277 \mbox{where ~}
2278 \ve{F}_1 = \Fvis -
2279 \dfrac{ \rvij \cdot \Fvis }
2280 { \rvij \cdot \rvij } \rvij
2281 \mbox{\,, ~}
2282 \ve{F}_2 = \ve{F}_1 -
2283 \dfrac{ \ve{r}_\perp \cdot \Fvis }
2284 { \ve{r}_\perp \cdot \ve{r}_\perp } \ve{r}_\perp
2285 \mbox{~and ~}
2286 \ve{F}_3 = \dfrac{ \rvij \cdot \Fvis }
2287 { \rvij \cdot \rvij } \ve{r}_\perp
2288 \end{array}
2289 \eeq
2291 \item[{\bf\sf 3out.}]\label{subsec:vsite3out}As a non-linear combination of three atoms, out of plane
2292 (\figref{vsites} 3out):
2293 \beq
2294 \vvis ~=~ \ve{r}_i + a \rvij + b \rvik +
2295 c (\rvij \times \rvik)
2296 \eeq
2297 This enables the construction of virtual sites out of the plane of the
2298 other atoms.
2299 The force on particles $i,j$ and $k$ due to the force on the virtual
2300 site can be computed as:
2301 \beq
2302 \begin{array}{lcl}
2303 \vspace{4mm}
2304 \Fj &=& \left[\begin{array}{ccc}
2305 a & -c\,z_{ik} & c\,y_{ik} \\[0.5ex]
2306 c\,z_{ik} & a & -c\,x_{ik} \\[0.5ex]
2307 -c\,y_{ik} & c\,x_{ik} & a
2308 \end{array}\right]\Fvis \\
2309 \vspace{4mm}
2310 \Fk &=& \left[\begin{array}{ccc}
2311 b & c\,z_{ij} & -c\,y_{ij} \\[0.5ex]
2312 -c\,z_{ij} & b & c\,x_{ij} \\[0.5ex]
2313 c\,y_{ij} & -c\,x_{ij} & b
2314 \end{array}\right]\Fvis \\
2315 \Fi &=& \Fvis - \Fj - \Fk
2316 \end{array}
2317 \eeq
2319 \item[{\bf\sf 4fdn.}]\label{subsec:vsite4fdn}From four atoms, with a fixed distance, see separate Fig.\ \ref{fig:vsite-4fdn}.
2320 This construction is a bit
2321 complex, in particular since the previous type (4fd) could be unstable which forced us
2322 to introduce a more elaborate construction:
2324 \begin{figure}
2325 \centerline{\includegraphics[width=5cm]{plots/vsite-4fdn}}
2326 \caption {The new 4fdn virtual site construction, which is stable even when all constructing
2327 atoms are in the same plane.}
2328 \label{fig:vsite-4fdn}
2329 \end{figure}
2331 \begin{eqnarray}
2332 \mathbf{r}_{ja} &=& a\, \mathbf{r}_{ik} - \mathbf{r}_{ij} = a\, (\mathbf{x}_k - \mathbf{x}_i) - (\mathbf{x}_j - \mathbf{x}_i) \nonumber \\
2333 \mathbf{r}_{jb} &=& b\, \mathbf{r}_{il} - \mathbf{r}_{ij} = b\, (\mathbf{x}_l - \mathbf{x}_i) - (\mathbf{x}_j - \mathbf{x}_i) \nonumber \\
2334 \mathbf{r}_m &=& \mathbf{r}_{ja} \times \mathbf{r}_{jb} \nonumber \\
2335 \mathbf{x}_s &=& \mathbf{x}_i + c \frac{\mathbf{r}_m}{|\mathbf{r}_m|}
2336 \label{eq:vsite}
2337 \end{eqnarray}
2339 In this case the virtual site is at a distance of $|c|$ from $i$, while $a$ and $b$ are
2340 parameters. {\bf Note} that the vectors $\mathbf{r}_{ik}$ and $\mathbf{r}_{ij}$ are not normalized
2341 to save floating-point operations.
2342 The force on particles $i$, $j$, $k$ and $l$ due to the force
2343 on the virtual site are computed through chain rule derivatives
2344 of the construction expression. This is exact and conserves energy,
2345 but it does lead to relatively lengthy expressions that we do not
2346 include here (over 200 floating-point operations). The interested reader can
2347 look at the source code in \verb+vsite.c+. Fortunately, this vsite type is normally
2348 only used for chiral centers such as $C_{\alpha}$ atoms in proteins.
2350 The new 4fdn construct is identified with a `type' value of 2 in the topology. The earlier 4fd
2351 type is still supported internally (`type' value 1), but it should not be used for
2352 new simulations. All current {\gromacs} tools will automatically generate type 4fdn instead.
2355 \item[{\bf\sf N.}]\label{subsec:vsiteN} A linear combination of $N$ atoms with relative
2356 weights $a_i$. The weight for atom $i$ is:
2357 \beq
2358 w_i = a_i \left(\sum_{j=1}^N a_j \right)^{-1}
2359 \eeq
2360 There are three options for setting the weights:
2361 \begin{itemize}
2362 \item[COG] center of geometry: equal weights
2363 \item[COM] center of mass: $a_i$ is the mass of atom $i$;
2364 when in free-energy simulations the mass of the atom is changed,
2365 only the mass of the A-state is used for the weight
2366 \item[COW] center of weights: $a_i$ is defined by the user
2367 \end{itemize}
2369 \end{itemize}
2370 %} % Brace matches ifthenelse test for gmxlite
2372 \newcommand{\dr}{{\rm d}r}
2373 \newcommand{\avcsix}{\left< C_6 \right>}
2375 %\ifthenelse{\equal{\gmxlite}{1}}{}{
2376 \section{Long Range Electrostatics}
2377 \label{sec:lr_elstat}
2378 \subsection{Ewald summation\index{Ewald sum}}
2379 \label{sec:ewald}
2380 The total electrostatic energy of $N$ particles and their periodic
2381 images\index{periodic boundary conditions} is given by
2382 \begin{equation}
2383 V=\frac{f}{2}\sum_{n_x}\sum_{n_y}
2384 \sum_{n_{z}*} \sum_{i}^{N} \sum_{j}^{N}
2385 \frac{q_i q_j}{{\bf r}_{ij,{\bf n}}}.
2386 \label{eqn:totalcoulomb}
2387 \end{equation}
2388 $(n_x,n_y,n_z)={\bf n}$ is the box index vector, and the star indicates that
2389 terms with $i=j$ should be omitted when $(n_x,n_y,n_z)=(0,0,0)$. The
2390 distance ${\bf r}_{ij,{\bf n}}$ is the real distance between the charges and
2391 not the minimum-image. This sum is conditionally convergent, but
2392 very slow.
2394 Ewald summation was first introduced as a method to calculate
2395 long-range interactions of the periodic images in
2396 crystals~\cite{Ewald21}. The idea is to convert the single
2397 slowly-converging sum \eqnref{totalcoulomb} into two
2398 quickly-converging terms and a constant term:
2399 \begin{eqnarray}
2400 V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex]
2401 V_{\mathrm{dir}} &=& \frac{f}{2} \sum_{i,j}^{N}
2402 \sum_{n_x}\sum_{n_y}
2403 \sum_{n_{z}*} q_i q_j \frac{\mbox{erfc}(\beta {r}_{ij,{\bf n}} )}{{r}_{ij,{\bf n}}} \\[0.5ex]
2404 V_{\mathrm{rec}} &=& \frac{f}{2 \pi V} \sum_{i,j}^{N} q_i q_j
2405 \sum_{m_x}\sum_{m_y}
2406 \sum_{m_{z}*} \frac{\exp{\left( -(\pi {\bf m}/\beta)^2 + 2 \pi i
2407 {\bf m} \cdot ({\bf r}_i - {\bf r}_j)\right)}}{{\bf m}^2} \\[0.5ex]
2408 V_{0} &=& -\frac{f \beta}{\sqrt{\pi}}\sum_{i}^{N} q_i^2,
2409 \end{eqnarray}
2410 where $\beta$ is a parameter that determines the relative weight of the
2411 direct and reciprocal sums and ${\bf m}=(m_x,m_y,m_z)$.
2412 In this way we can use a short cut-off (of the order of $1$~nm) in the direct space sum and a
2413 short cut-off in the reciprocal space sum ({\eg} 10 wave vectors in each
2414 direction). Unfortunately, the computational cost of the reciprocal
2415 part of the sum increases as $N^2$
2416 (or $N^{3/2}$ with a slightly better algorithm) and it is therefore not
2417 realistic for use in large systems.
2419 \subsubsection{Using Ewald}
2420 Don't use Ewald unless you are absolutely sure this is what you want -
2421 for almost all cases the PME method below will perform much better.
2422 If you still want to employ classical Ewald summation enter this in
2423 your {\tt .mdp} file, if the side of your box is about $3$~nm:
2425 \begin{verbatim}
2426 coulombtype = Ewald
2427 rvdw = 0.9
2428 rlist = 0.9
2429 rcoulomb = 0.9
2430 fourierspacing = 0.6
2431 ewald-rtol = 1e-5
2432 \end{verbatim}
2434 The ratio of the box dimensions and the {\tt fourierspacing} parameter determines
2435 the highest magnitude of wave vectors $m_x,m_y,m_z$ to use in each
2436 direction. With a 3-nm cubic box this example would use $11$ wave vectors
2437 (from $-5$ to $5$) in each direction. The {\tt ewald-rtol} parameter
2438 is the relative strength of the electrostatic interaction at the
2439 cut-off. Decreasing this gives you a more accurate direct sum, but a
2440 less accurate reciprocal sum.
2442 \subsection{\normindex{PME}}
2443 \label{sec:pme}
2444 Particle-mesh Ewald is a method proposed by Tom
2445 Darden~\cite{Darden93} to improve the performance of the
2446 reciprocal sum. Instead of directly summing wave vectors, the charges
2447 are assigned to a grid using interpolation. The implementation in
2448 {\gromacs} uses cardinal B-spline interpolation~\cite{Essmann95},
2449 which is referred to as smooth PME (SPME).
2450 The grid is then Fourier transformed with a 3D FFT algorithm and the
2451 reciprocal energy term obtained by a single sum over the grid in
2452 k-space.
2454 The potential at the grid points is calculated by inverse
2455 transformation, and by using the interpolation factors we get the
2456 forces on each atom.
2458 The PME algorithm scales as $N \log(N)$, and is substantially faster
2459 than ordinary Ewald summation on medium to large systems. On very
2460 small systems it might still be better to use Ewald to avoid the
2461 overhead in setting up grids and transforms.
2462 For the parallelization of PME see the section on MPMD PME (\ssecref{mpmd_pme}).
2464 With the Verlet cut-off scheme, the PME direct space potential is
2465 shifted by a constant such that the potential is zero at the
2466 cut-off. This shift is small and since the net system charge is close
2467 to zero, the total shift is very small, unlike in the case of the
2468 Lennard-Jones potential where all shifts add up. We apply the shift
2469 anyhow, such that the potential is the exact integral of the force.
2471 \subsubsection{Using PME}
2472 As an example for using Particle-mesh Ewald summation in {\gromacs}, specify the
2473 following lines in your {\tt .mdp} file:
2475 \begin{verbatim}
2476 coulombtype = PME
2477 rvdw = 0.9
2478 rlist = 0.9
2479 rcoulomb = 0.9
2480 fourierspacing = 0.12
2481 pme-order = 4
2482 ewald-rtol = 1e-5
2483 \end{verbatim}
2485 In this case the {\tt fourierspacing} parameter determines the maximum
2486 spacing for the FFT grid (i.e. minimum number of grid points),
2487 and {\tt pme-order} controls the
2488 interpolation order. Using fourth-order (cubic) interpolation and this
2489 spacing should give electrostatic energies accurate to about
2490 $5\cdot10^{-3}$. Since the Lennard-Jones energies are not this
2491 accurate it might even be possible to increase this spacing slightly.
2493 Pressure scaling works with PME, but be aware of the fact that
2494 anisotropic scaling can introduce artificial ordering in some systems.
2496 \subsection{\normindex{P3M-AD}}
2497 \label{sec:pppm}
2498 The \seeindex{Particle-Particle Particle-Mesh}{P3M} methods of
2499 Hockney \& Eastwood can also be applied in {\gromacs} for the
2500 treatment of long range electrostatic interactions~\cite{Hockney81}.
2501 Although the P3M method was the first efficient long-range electrostatics
2502 method for molecular simulation, the smooth PME (SPME) method has largely
2503 replaced P3M as the method of choice in atomistic simulations. One performance
2504 disadvantage of the original P3M method was that it required 3 3D-FFT
2505 back transforms to obtain the forces on the particles. But this is not
2506 required for P3M and the forces can be derived through analytical differentiation
2507 of the potential, as done in PME. The resulting method is termed P3M-AD.
2508 The only remaining difference between P3M-AD and PME is the optimization
2509 of the lattice Green influence function for error minimization that P3M uses.
2510 However, in 2012 it has been shown that the SPME influence function can be
2511 modified to obtain P3M~\cite{Ballenegger2012}.
2512 This means that the advantage of error minimization in P3M-AD can be used
2513 at the same computational cost and with the same code as PME,
2514 just by adding a few lines to modify the influence function.
2515 However, at optimal parameter setting the effect of error minimization
2516 in P3M-AD is less than 10\%. P3M-AD does show large accuracy gains with
2517 interlaced (also known as staggered) grids, but that is not supported
2518 in {\gromacs} (yet).
2520 P3M is used in {\gromacs} with exactly the same options as used with PME
2521 by selecting the electrostatics type:
2522 \begin{verbatim}
2523 coulombtype = P3M-AD
2524 \end{verbatim}
2526 \subsection{Optimizing Fourier transforms and PME calculations}
2527 It is recommended to optimize the parameters for calculation of
2528 electrostatic interaction such as PME grid dimensions and cut-off radii.
2529 This is particularly relevant to do before launching long production runs.
2531 {\tt gmx mdrun} will automatically do a lot of PME optimization, and
2532 {\gromacs} also includes a special tool, {\tt gmx tune_pme}, which
2533 automates the process of selecting the optimal number of PME-only ranks.
2535 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2539 %\ifthenelse{\equal{\gmxlite}{1}}{}{
2540 \section{Long Range Van der Waals interactions}
2541 \subsection{Dispersion correction\index{dispersion correction}}
2542 In this section, we derive long-range corrections due to the use of a
2543 cut-off for Lennard-Jones or Buckingham interactions.
2544 We assume that the cut-off is
2545 so long that the repulsion term can safely be neglected, and therefore
2546 only the dispersion term is taken into account. Due to the nature of
2547 the dispersion interaction (we are truncating a potential proportional
2548 to $-r^{-6}$), energy and pressure corrections are both negative. While
2549 the energy correction is usually small, it may be important for free
2550 energy calculations where differences between two different Hamiltonians
2551 are considered. In contrast, the pressure correction is very large and
2552 can not be neglected under any circumstances where a correct pressure is
2553 required, especially for any NPT simulations. Although it is, in
2554 principle, possible to parameterize a force field such that the pressure
2555 is close to the desired experimental value without correction, such a
2556 method makes the parameterization dependent on the cut-off and is therefore
2557 undesirable.
2559 \subsubsection{Energy}
2560 \label{sec:ecorr}
2561 The long-range contribution of the dispersion interaction to the
2562 virial can be derived analytically, if we assume a homogeneous
2563 system beyond the cut-off distance $r_c$. The dispersion energy
2564 between two particles is written as:
2565 \beq
2566 V(\rij) ~=~- C_6\,\rij^{-6}
2567 \eeq
2568 and the corresponding force is:
2569 \beq
2570 \Fvij ~=~- 6\,C_6\,\rij^{-8}\rvij
2571 \eeq
2572 In a periodic system it is not easy to calculate the full potentials,
2573 so usually a cut-off is applied, which can be abrupt or smooth.
2574 We will call the potential and force with cut-off $V_c$ and $\ve{F}_c$.
2575 The long-range contribution to the dispersion energy
2576 in a system with $N$ particles and particle density $\rho$ = $N/V$ is:
2577 \beq
2578 \label{eqn:enercorr}
2579 V_{lr} ~=~ \half N \rho\int_0^{\infty} 4\pi r^2 g(r) \left( V(r) -V_c(r) \right) {\dr}
2580 \eeq
2581 We will integrate this for the shift function, which is the most general
2582 form of van der Waals interaction available in {\gromacs}.
2583 The shift function has a constant difference $S$ from 0 to $r_1$
2584 and is 0 beyond the cut-off distance $r_c$.
2585 We can integrate \eqnref{enercorr}, assuming that the density in the sphere
2586 within $r_1$ is equal to the global density and
2587 the radial distribution function $g(r)$ is 1 beyond $r_1$:
2588 \bea
2589 \nonumber
2590 V_{lr} &=& \half N \left(
2591 \rho\int_0^{r_1} 4\pi r^2 g(r) \, C_6 \,S\,{\dr}
2592 + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {\dr}
2593 + \rho\int_{r_c}^{\infty} 4\pi r^2 V(r) \, {\dr}
2594 \right) \\
2595 & = & \half N \left(\left(\frac{4}{3}\pi \rho r_1^{3} - 1\right) C_6 \,S
2596 + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {\dr}
2597 -\frac{4}{3} \pi N \rho\, C_6\,r_c^{-3}
2598 \right)
2599 \eea
2600 where the term $-1$ corrects for the self-interaction.
2601 For a plain cut-off we only need to assume that $g(r)$ is 1 beyond $r_c$
2602 and the correction reduces to~\cite{Allen87}:
2603 \bea
2604 V_{lr} & = & -\frac{2}{3} \pi N \rho\, C_6\,r_c^{-3}
2605 \eea
2606 If we consider, for example, a box of pure water, simulated with a cut-off
2607 of 0.9 nm and a density of 1 g cm$^{-3}$ this correction is
2608 $-0.75$ kJ mol$^{-1}$ per molecule.
2610 For a homogeneous mixture we need to define
2611 an {\em average dispersion constant}:
2612 \beq
2613 \label{eqn:avcsix}
2614 \avcsix = \frac{2}{N(N-1)}\sum_i^N\sum_{j>i}^N C_6(i,j)\\
2615 \eeq
2616 In {\gromacs}, excluded pairs of atoms do not contribute to the average.
2618 In the case of inhomogeneous simulation systems, {\eg} a system with a
2619 lipid interface, the energy correction can be applied if
2620 $\avcsix$ for both components is comparable.
2622 \subsubsection{Virial and pressure}
2623 The scalar virial of the system due to the dispersion interaction between
2624 two particles $i$ and $j$ is given by:
2625 \beq
2626 \Xi~=~-\half \rvij \cdot \Fvij ~=~ 3\,C_6\,\rij^{-6}
2627 \eeq
2628 The pressure is given by:
2629 \beq
2630 P~=~\frac{2}{3\,V}\left(E_{kin} - \Xi\right)
2631 \eeq
2632 The long-range correction to the virial is given by:
2633 \beq
2634 \Xi_{lr} ~=~ \half N \rho \int_0^{\infty} 4\pi r^2 g(r) (\Xi -\Xi_c) \,\dr
2635 \eeq
2636 We can again integrate the long-range contribution to the
2637 virial assuming $g(r)$ is 1 beyond $r_1$:
2638 \bea
2639 \Xi_{lr}&=& \half N \rho \left(
2640 \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \,\dr
2641 + \int_{r_c}^{\infty} 4 \pi r^2 3\,C_6\,\rij^{-6}\, \dr
2642 \right) \nonumber\\
2643 &=& \half N \rho \left(
2644 \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \, \dr
2645 + 4 \pi C_6 \, r_c^{-3} \right)
2646 \eea
2647 For a plain cut-off the correction to the pressure is~\cite{Allen87}:
2648 \beq
2649 P_{lr}~=~-\frac{4}{3} \pi C_6\, \rho^2 r_c^{-3}
2650 \eeq
2651 Using the same example of a water box, the correction to the virial is
2652 0.75 kJ mol$^{-1}$ per molecule,
2653 the corresponding correction to the pressure for
2654 SPC water is approximately $-280$ bar.
2656 For homogeneous mixtures, we can again use the average dispersion constant
2657 $\avcsix$ (\eqnref{avcsix}):
2658 \beq
2659 P_{lr}~=~-\frac{4}{3} \pi \avcsix \rho^2 r_c^{-3}
2660 \label{eqn:pcorr}
2661 \eeq
2662 For inhomogeneous systems, \eqnref{pcorr} can be applied under the same
2663 restriction as holds for the energy (see \secref{ecorr}).
2665 \subsection{Lennard-Jones PME\index{LJ-PME}}
2667 In order to treat systems, using Lennard-Jones potentials, that are
2668 non-homogeneous outside of the cut-off distance, we can instead use
2669 the Particle-mesh Ewald method as discussed for electrostatics above.
2670 In this case the modified Ewald equations become
2671 \begin{eqnarray}
2672 V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex]
2673 V_{\mathrm{dir}} &=& -\frac{1}{2} \sum_{i,j}^{N}
2674 \sum_{n_x}\sum_{n_y}
2675 \sum_{n_{z}*} \frac{C^{ij}_6 g(\beta {r}_{ij,{\bf n}})}{{r_{ij,{\bf n}}}^6}
2676 \label{eqn:ljpmerealspace}\\[0.5ex]
2677 V_{\mathrm{rec}} &=& \frac{{\pi}^{\frac{3}{2}} \beta^{3}}{2V} \sum_{m_x}\sum_{m_y}\sum_{m_{z}*}
2678 f(\pi |{\mathbf m}|/\beta) \times \sum_{i,j}^{N} C^{ij}_6 {\mathrm{exp}}\left[-2\pi i {\bf m}\cdot({\bf r_i}-{\bf r_j})\right] \\[0.5ex]
2679 V_{0} &=& -\frac{\beta^{6}}{12}\sum_{i}^{N} C^{ii}_6
2680 \end{eqnarray}
2682 where ${\bf m}=(m_x,m_y,m_z)$, $\beta$ is the parameter determining the weight between
2683 direct and reciprocal space, and ${C^{ij}_6}$ is the combined dispersion
2684 parameter for particle $i$ and $j$. The star indicates that terms
2685 with $i = j$ should be omitted when $((n_x,n_y,n_z)=(0,0,0))$, and
2686 ${\bf r}_{ij,{\bf n}}$ is the real distance between the particles.
2687 Following the derivation by Essmann~\cite{Essmann95}, the functions $f$ and $g$ introduced above are defined as
2688 \begin{eqnarray}
2689 f(x)&=&1/3\left[(1-2x^2){\mathrm{exp}}(-x^2) + 2{x^3}\sqrt{\pi}\,{\mathrm{erfc}}(x) \right] \\
2690 g(x)&=&{\mathrm{exp}}(-x^2)(1+x^2+\frac{x^4}{2}).
2691 \end{eqnarray}
2693 The above methodology works fine as long as the dispersion parameters can be combined geometrically (\eqnref{comb}) in the same
2694 way as the charges for electrostatics
2695 \begin{equation}
2696 C^{ij}_{6,\mathrm{geom}} = \left(C^{ii}_6 \, C^{jj}_6\right)^{1/2}
2697 \end{equation}
2698 For Lorentz-Berthelot combination rules (\eqnref{lorentzberthelot}), the reciprocal part of this sum has to be calculated
2699 seven times due to the splitting of the dispersion parameter according to
2700 \begin{equation}
2701 C^{ij}_{6,\mathrm{L-B}} = (\sigma_i+\sigma_j)^6=\sum_{n=0}^{6} P_{n}\sigma_{i}^{n}\sigma_{j}^{(6-n)},
2702 \end{equation}
2703 for $P_{n}$ the Pascal triangle coefficients. This introduces a
2704 non-negligible cost to the reciprocal part, requiring seven separate
2705 FFTs, and therefore this has been the limiting factor in previous
2706 attempts to implement LJ-PME. A solution to this problem is to use
2707 geometrical combination rules in order to calculate an approximate
2708 interaction parameter for the reciprocal part of the potential,
2709 yielding a total interaction of
2710 \begin{eqnarray}
2711 V(r<r_c) & = & \underbrace{C^{\mathrm{dir}}_6 g(\beta r) r^{-6}}_{\mathrm{Direct \ space}} + \underbrace{C^\mathrm{recip}_{6,\mathrm{geom}} [1 - g(\beta r)] r^{-6}}_{\mathrm{Reciprocal \ space}} \nonumber \\
2712 &=& C^\mathrm{recip}_{6,\mathrm{geom}}r^{-6} + \left(C^{\mathrm{dir}}_6-C^\mathrm{recip}_{6,\mathrm{geom}}\right)g(\beta r)r^{-6} \\
2713 V(r>r_c) & = & \underbrace{C^\mathrm{recip}_{6,\mathrm{geom}} [1 - g(\beta r)] r^{-6}}_{\mathrm{Reciprocal \ space}}.
2714 \end{eqnarray}
2715 This will preserve a well-defined Hamiltonian and significantly increase
2716 the performance of the simulations. The approximation does introduce
2717 some errors, but since the difference is located in the interactions
2718 calculated in reciprocal space, the effect will be very small compared
2719 to the total interaction energy. In a simulation of a lipid bilayer,
2720 using a cut-off of 1.0 nm, the relative error in total dispersion
2721 energy was below 0.5\%. A more thorough discussion of this can be
2722 found in \cite{Wennberg13}.
2724 In {\gromacs} we now perform the proper calculation of this interaction
2725 by subtracting, from the direct-space interactions, the contribution
2726 made by the approximate potential that is used in the reciprocal part
2727 \begin{equation}
2728 V_\mathrm{dir} = C^{\mathrm{dir}}_6 r^{-6} - C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}.
2729 \label{eqn:ljpmedirectspace}
2730 \end{equation}
2731 This potential will reduce to the expression in \eqnref{ljpmerealspace} when $C^{\mathrm{dir}}_6 = C^\mathrm{recip}_6$,
2732 and the total interaction is given by
2733 \begin{eqnarray}
2734 \nonumber V(r<r_c) &=& \underbrace{C^{\mathrm{dir}}_6 r^{-6} - C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}}_{\mathrm{Direct \ space}} + \underbrace{C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}}_{\mathrm{Reciprocal \ space}} \\
2735 &=&C^{\mathrm{dir}}_6 r^{-6}
2736 \label {eqn:ljpmecorr2} \\
2737 V(r>r_c) &=& C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}.
2738 \end{eqnarray}
2739 For the case when $C^{\mathrm{dir}}_6 \neq C^\mathrm{recip}_6$ this
2740 will retain an unmodified LJ force up to the cut-off, and the error
2741 is an order of magnitude smaller than in simulations where the
2742 direct-space interactions do not account for the approximation used in
2743 reciprocal space. When using a VdW interaction modifier of
2744 potential-shift, the constant
2745 \begin{equation}
2746 \left(-C^{\mathrm{dir}}_6 + C^\mathrm{recip}_6 [1 - g(\beta r_c)]\right) r_c^{-6}
2747 \end{equation}
2748 is added to \eqnref{ljpmecorr2} in order to ensure that the potential
2749 is continuous at the cutoff. Note that, in the same way as \eqnref{ljpmedirectspace}, this degenerates into the
2750 expected $-C_6g(\beta r_c)r^{-6}_c$ when $C^{\mathrm{dir}}_6 =
2751 C^\mathrm{recip}_6$. In addition to this, a long-range dispersion
2752 correction can be applied to correct for the approximation using a
2753 combination rule in reciprocal space. This correction assumes, as for
2754 the cut-off LJ potential, a uniform particle distribution. But since
2755 the error of the combination rule approximation is very small this
2756 long-range correction is not necessary in most cases. Also note that
2757 this homogenous correction does not correct the surface tension, which
2758 is an inhomogeneous property.
2760 \subsubsection{Using LJ-PME}
2761 As an example for using Particle-mesh Ewald summation for Lennard-Jones interactions in {\gromacs}, specify the
2762 following lines in your {\tt .mdp} file:
2763 \begin{verbatim}
2764 vdwtype = PME
2765 rvdw = 0.9
2766 vdw-modifier = Potential-Shift
2767 rlist = 0.9
2768 rcoulomb = 0.9
2769 fourierspacing = 0.12
2770 pme-order = 4
2771 ewald-rtol-lj = 0.001
2772 lj-pme-comb-rule = geometric
2773 \end{verbatim}
2775 The same Fourier grid and interpolation order are used if both
2776 LJ-PME and electrostatic PME are active, so the settings for
2777 {\tt fourierspacing} and {\tt pme-order} are common to both.
2778 {\tt ewald-rtol-lj} controls the
2779 splitting between direct and reciprocal space in the same way as
2780 {\tt ewald-rtol}. In addition to this, the combination rule to be used
2781 in reciprocal space is determined by {\tt lj-pme-comb-rule}. If the
2782 current force field uses Lorentz-Berthelot combination rules, it is
2783 possible to set {\tt lj-pme-comb-rule = geometric} in order to gain a
2784 significant increase in performance for a small loss in accuracy. The
2785 details of this approximation can be found in the section above.
2787 Note that the use of a complete long-range dispersion correction means
2788 that as with Coulomb PME, {\tt rvdw} is now a free parameter in the
2789 method, rather than being necessarily restricted by the force-field
2790 parameterization scheme. Thus it is now possible to optimize the
2791 cutoff, spacing, order and tolerance terms for accuracy and best
2792 performance.
2794 Naturally, the use of LJ-PME rather than LJ cut-off adds computation
2795 and communication done for the reciprocal-space part, so for best
2796 performance in balancing the load of parallel simulations using
2797 PME-only ranks, more such ranks should be used. It may be possible to
2798 improve upon the automatic load-balancing used by {\tt mdrun}.
2800 %} % Brace matches ifthenelse test for gmxlite
2802 \section{Force field\index{force field}}
2803 \label{sec:ff}
2804 A force field is built up from two distinct components:
2805 \begin{itemize}
2806 \item The set of equations (called the {\em
2807 potential functions}\index{potential function}) used to generate the potential
2808 energies and their derivatives, the forces. These are described in
2809 detail in the previous chapter.
2810 \item The parameters used in this set of equations. These are not
2811 given in this manual, but in the data files corresponding to your
2812 {\gromacs} distribution.
2813 \end{itemize}
2814 Within one set of equations various sets of parameters can be
2815 used. Care must be taken that the combination of equations and
2816 parameters form a consistent set. It is in general dangerous to make
2817 {\em ad hoc} changes in a subset of parameters, because the various
2818 contributions to the total force are usually interdependent. This
2819 means in principle that every change should be documented, verified by
2820 comparison to experimental data and published in a peer-reviewed
2821 journal before it can be used.
2823 {\gromacs} {\gmxver} includes several force fields, and additional
2824 ones are available on the website. If you do not know which one to
2825 select we recommend \gromosv{96} for united-atom setups and OPLS-AA/L for
2826 all-atom parameters. That said, we describe the available options in
2827 some detail.
2829 \subsubsection{All-hydrogen force field}
2830 The \gromosv{87}-based all-hydrogen force field is almost identical to the
2831 normal \gromosv{87} force field, since the extra hydrogens have no
2832 Lennard-Jones interaction and zero charge. The only differences are in
2833 the bond angle and improper dihedral angle terms. This force field is
2834 only useful when you need the exact hydrogen positions, for instance
2835 for distance restraints derived from NMR measurements. When citing
2836 this force field please read the previous paragraph.
2838 \subsection{\gromosv{96}\index{GROMOS96 force field}}
2839 {\gromacs} supports the \gromosv{96} force fields~\cite{gromos96}.
2840 All parameters for the 43A1, 43A2 (development, improved alkane
2841 dihedrals), 45A3, 53A5, and 53A6 parameter sets are included. All standard
2842 building blocks are included and topologies can be built automatically
2843 by {\tt pdb2gmx}.
2845 The \gromosv{96} force field is a further development of the \gromosv{87} force field.
2846 It has improvements over the \gromosv{87} force field for proteins and small molecules.
2847 {\bf Note} that the sugar parameters present in 53A6 do correspond to those published in
2848 2004\cite{Oostenbrink2004}, which are different from those present in 45A4, which
2849 is not included in {\gromacs} at this time. The 45A4 parameter set corresponds to a later
2850 revision of these parameters.
2851 The \gromosv{96} force field is not, however, recommended for use with long alkanes and
2852 lipids. The \gromosv{96} force field differs from the \gromosv{87}
2853 force field in a few respects:
2854 \begin{itemize}
2855 \item the force field parameters
2856 \item the parameters for the bonded interactions are not linked to atom types
2857 \item a fourth power bond stretching potential (\ssecref{G96bond})
2858 \item an angle potential based on the cosine of the angle (\ssecref{G96angle})
2859 \end{itemize}
2860 There are two differences in implementation between {\gromacs} and \gromosv{96}
2861 which can lead to slightly different results when simulating the same system
2862 with both packages:
2863 \begin{itemize}
2864 \item in \gromosv{96} neighbor searching for solvents is performed on the
2865 first atom of the solvent molecule. This is not implemented in {\gromacs},
2866 but the difference with searching by centers of charge groups is very small
2867 \item the virial in \gromosv{96} is molecule-based. This is not implemented in
2868 {\gromacs}, which uses atomic virials
2869 \end{itemize}
2870 The \gromosv{96} force field was parameterized with a Lennard-Jones cut-off
2871 of 1.4 nm, so be sure to use a Lennard-Jones cut-off ({\tt rvdw}) of at least 1.4.
2872 A larger cut-off is possible because the Lennard-Jones potential and forces
2873 are almost zero beyond 1.4 nm.
2875 \subsubsection{\gromosv{96} files\swapindexquiet{GROMOS96}{files}}
2876 {\gromacs} can read and write \gromosv{96} coordinate and trajectory files.
2877 These files should have the extension {\tt .g96}.
2878 Such a file can be a \gromosv{96} initial/final
2879 configuration file, a coordinate trajectory file, or a combination of both.
2880 The file is fixed format; all floats are written as 15.9, and as such, files can get huge.
2881 {\gromacs} supports the following data blocks in the given order:
2882 \begin{itemize}
2883 \item Header block:
2884 \begin{verbatim}
2885 TITLE (mandatory)
2886 \end{verbatim}
2888 \item Frame blocks:
2889 \begin{verbatim}
2890 TIMESTEP (optional)
2891 POSITION/POSITIONRED (mandatory)
2892 VELOCITY/VELOCITYRED (optional)
2893 BOX (optional)
2894 \end{verbatim}
2896 \end{itemize}
2897 See the \gromosv{96} manual~\cite{gromos96} for a complete description
2898 of the blocks. {\bf Note} that all {\gromacs} programs can read compressed
2899 (.Z) or gzipped (.gz) files.
2901 \subsection{OPLS/AA\index{OPLS/AA force field}}
2903 \subsection{AMBER\index{AMBER force field}}
2905 {\gromacs} provides native support for the following AMBER force fields:
2907 \begin{itemize}
2908 \item AMBER94~\cite{Cornell1995}
2909 \item AMBER96~\cite{Kollman1996}
2910 \item AMBER99~\cite{Wang2000}
2911 \item AMBER99SB~\cite{Hornak2006}
2912 \item AMBER99SB-ILDN~\cite{Lindorff2010}
2913 \item AMBER03~\cite{Duan2003}
2914 \item AMBERGS~\cite{Garcia2002}
2915 \end{itemize}
2917 \subsection{CHARMM\index{CHARMM force field}}
2918 \label{subsec:charmmff}
2920 {\gromacs} supports the CHARMM force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00,Mac2000}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) and a fast implicit solvent recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
2922 When selecting the CHARMM force field in {\tt \normindex{pdb2gmx}} the default option is to use \normindex{CMAP} (for torsional correction map). To exclude CMAP, use {\tt -nocmap}. The basic form of the CMAP term implemented in {\gromacs} is a function of the $\phi$ and $\psi$ backbone torsion angles. This term is defined in the {\tt .rtp} file by a {\tt [ cmap ]} statement at the end of each residue supporting CMAP. The following five atom names define the two torsional angles. Atoms 1-4 define $\phi$, and atoms 2-5 define $\psi$. The corresponding atom types are then matched to the correct CMAP type in the {\tt cmap.itp} file that contains the correction maps.
2924 A port of the CHARMM36 force field for use with GROMACS is also available at \url{http://mackerell.umaryland.edu/charmm_ff.shtml#gromacs}.
2926 For branched polymers or other topologies not supported by {\tt \normindex{pdb2gmx}}, it is possible to use TopoTools~\cite{kohlmeyer2016} to generate a {\gromacs} top file.
2928 \subsection{Coarse-grained force fields}
2929 \index{force-field, coarse-grained}
2930 \label{sec:cg-forcefields}
2931 Coarse-graining is a systematic way of reducing the number of degrees of freedom representing a system of interest. To achieve this, typically whole groups of atoms are represented by single beads and the coarse-grained force fields describes their effective interactions. Depending on the choice of parameterization, the functional form of such an interaction can be complicated and often tabulated potentials are used.
2933 Coarse-grained models are designed to reproduce certain properties of a reference system. This can be either a full atomistic model or even experimental data. Depending on the properties to reproduce there are different methods to derive such force fields. An incomplete list of methods is given below:
2934 \begin{itemize}
2935 \item Conserving free energies
2936 \begin{itemize}
2937 \item Simplex method
2938 \item MARTINI force field (see next section)
2939 \end{itemize}
2940 \item Conserving distributions (like the radial distribution function), so-called structure-based coarse-graining
2941 \begin{itemize}
2942 \item (iterative) Boltzmann inversion
2943 \item Inverse Monte Carlo
2944 \end{itemize}
2945 \item Conversing forces
2946 \begin{itemize}
2947 \item Force matching
2948 \end{itemize}
2949 \end{itemize}
2951 Note that coarse-grained potentials are state dependent (e.g. temperature, density,...) and should be re-parametrized depending on the system of interest and the simulation conditions. This can for example be done using the \normindex{Versatile Object-oriented Toolkit for Coarse-Graining Applications (VOTCA)}~\cite{ruehle2009}. The package was designed to assists in systematic coarse-graining, provides implementations for most of the algorithms mentioned above and has a well tested interface to {\gromacs}. It is available as open source and further information can be found at \href{http://www.votca.org}{www.votca.org}.
2953 \subsection{MARTINI\index{Martini force field}}
2955 The MARTINI force field is a coarse-grain parameter set that allows for the construction
2956 of many systems, including proteins and membranes.
2958 \subsection{PLUM\index{PLUM force field}}
2960 The \normindex{PLUM force field}~\cite{bereau12} is an example of a solvent-free
2961 protein-membrane model for which the membrane was derived from structure-based
2962 coarse-graining~\cite{wang_jpcb10}. A {\gromacs} implementation can be found at
2963 \href{http://code.google.com/p/plumx/}{code.google.com/p/plumx}.
2965 % LocalWords: dihedrals centro ij dV dr LJ lj rcl jj Bertelot OPLS bh bham rf
2966 % LocalWords: coul defunits grompp crf vcrf fcrf Tironi Debye kgrf cgrf krf dx
2967 % LocalWords: PPPM der Waals erfc lr elstat chirality bstretch bondpot kT kJ
2968 % LocalWords: anharmonic morse mol betaij expminx SPC timestep fs FENE ijk kj
2969 % LocalWords: anglepot CHARMm UB ik rr substituents ijkl Ryckaert Bellemans rb
2970 % LocalWords: alkanes pdb gmx IUPAC IUB jkl cis rbdih crb kcal cubicspline xvg
2971 % LocalWords: topfile mdrun posres ar dihr lcllll NMR nmr lcllllll NOEs lclll
2972 % LocalWords: rav preprocessor ccccccccc ai aj fac disre mdp multi topol tpr
2973 % LocalWords: fc ravdisre nstdisreout dipolar lll ccc orientational MSD const
2974 % LocalWords: orire fitgrp nstorireout Drude intra Noskov et al fecalc coulrf
2975 % LocalWords: polarizabilities parameterized sigeps Ek sc softcore GROMOS NBF
2976 % LocalWords: hydrogens alkane vdwtype coulombtype rlist rcoulomb rvdw
2977 % LocalWords: nstlist virial funcparm VdW jk jl fvsite fd vsites lcr vsitetop
2978 % LocalWords: vsite lclllll lcl parameterize parameterization enercorr avcsix
2979 % LocalWords: pcorr ecorr totalcoulomb dir fourierspacing ewald rtol Darden gz
2980 % LocalWords: FFT parallelization MPMD mpmd pme fft hoc Gromos gromos oxygens
2981 % LocalWords: virials POSITIONRED VELOCITYRED gzipped Charmm Larsson Bjelkmar
2982 % LocalWords: Cuendet CMAP nocmap dihedral Lennard covalent Verlet
2983 % LocalWords: Berthelot nm flexwat ferguson itp harmonicangle versa
2984 % LocalWords: harmonicbond atomtypes dihedraltypes equilibrated fdn
2985 % LocalWords: distancerestraint LINCS Coulombic ja jb il SPME ILDN
2986 % LocalWords: Hamiltonians atomtype AMBERGS rtp cmap graining VOTCA