1Non-bonded interactions 2----------------------- 3 4Non-bonded interactions in |Gromacs| are pair-additive: 5 6.. math:: V(\mathbf{r}_1,\ldots \mathbf{r}_N) = \sum_{i<j}V_{ij}(\mathbf{r}_{ij}); 7 :label: eqnnbinteractions1 8 9.. math:: \mathbf{F}_i = -\sum_j \frac{dV_{ij}(r_{ij})}{dr_{ij}} \frac{\mathbf{r}_{ij}}{r_{ij}} 10 :label: eqnnbinteractions2 11 12Since the potential only depends on the scalar distance, interactions 13will be centro-symmetric, i.e. the vectorial partial force on particle 14:math:`i` from the pairwise interaction :math:`V_{ij}(r_{ij})` has the 15opposite direction of the partial force on particle :math:`j`. For 16efficiency reasons, interactions are calculated by loops over 17interactions and updating both partial forces rather than summing one 18complete nonbonded force at a time. The non-bonded interactions contain 19a repulsion term, a dispersion term, and a Coulomb term. The repulsion 20and dispersion term are combined in either the Lennard-Jones (or 6-12 21interaction), or the Buckingham (or exp-6 potential). In addition, 22(partially) charged atoms act through the Coulomb term. 23 24.. _lj: 25 26The Lennard-Jones interaction 27~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 28 29The Lennard-Jones potential :math:`V_{LJ}` between two atoms equals: 30 31.. math:: V_{LJ}({r_{ij}}) = \frac{C_{ij}^{(12)}}{{r_{ij}}^{12}} - 32 \frac{C_{ij}^{(6)}}{{r_{ij}}^6} 33 :label: eqnnblj 34 35See also :numref:`Fig. %s <fig-lj>` The parameters :math:`C^{(12)}_{ij}` and 36:math:`C^{(6)}_{ij}` depend on pairs of *atom types*; consequently they 37are taken from a matrix of LJ-parameters. In the Verlet cut-off scheme, 38the potential is shifted by a constant such that it is zero at the 39cut-off distance. 40 41.. _fig-lj: 42 43.. figure:: plots/f-lj.* 44 :width: 8.00000cm 45 46 The Lennard-Jones interaction. 47 48The force derived from this potential is: 49 50.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -\left( 12~\frac{C_{ij}^{(12)}}{{r_{ij}}^{13}} - 51 6~\frac{C_{ij}^{(6)}}{{r_{ij}}^7} \right) {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} 52 :label: eqnljforce 53 54The LJ potential may also be written in the following form: 55 56.. math:: V_{LJ}(\mathbf{r}_{ij}) = 4\epsilon_{ij}\left(\left(\frac{\sigma_{ij}} {{r_{ij}}}\right)^{12} 57 - \left(\frac{\sigma_{ij}}{{r_{ij}}}\right)^{6} \right) 58 :label: eqnsigeps 59 60In constructing the parameter matrix for the non-bonded LJ-parameters, 61two types of combination rules can be used within |Gromacs|, only 62geometric averages (type 1 in the input section of the force-field 63file): 64 65.. math:: \begin{array}{rcl} 66 C_{ij}^{(6)} &=& \left({C_{ii}^{(6)} \, C_{jj}^{(6)}}\right)^{1/2} \\ 67 C_{ij}^{(12)} &=& \left({C_{ii}^{(12)} \, C_{jj}^{(12)}}\right)^{1/2} 68 \end{array} 69 :label: eqncomb 70 71or, alternatively the Lorentz-Berthelot rules can be used. An 72arithmetic average is used to calculate :math:`\sigma_{ij}`, while a 73geometric average is used to calculate :math:`\epsilon_{ij}` (type 2): 74 75.. math:: \begin{array}{rcl} 76 \sigma_{ij} &=& \frac{1}{ 2}(\sigma_{ii} + \sigma_{jj}) \\ 77 \epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2} 78 \end{array} 79 :label: eqnlorentzberthelot 80 81finally an geometric average for both parameters can be used (type 3): 82 83.. math:: \begin{array}{rcl} 84 \sigma_{ij} &=& \left({\sigma_{ii} \, \sigma_{jj}}\right)^{1/2} \\ 85 \epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2} 86 \end{array} 87 :label: eqnnbgeometricaverage 88 89This last rule is used by the OPLS force field. 90 91Buckingham potential 92~~~~~~~~~~~~~~~~~~~~ 93 94The Buckingham potential has a more flexible and realistic repulsion 95term than the Lennard-Jones interaction, but is also more expensive to 96compute. The potential form is: 97 98.. math:: V_{bh}({r_{ij}}) = A_{ij} \exp(-B_{ij} {r_{ij}}) - 99 \frac{C_{ij}}{{r_{ij}}^6} 100 :label: eqnnbbuckingham 101 102.. _fig-bham: 103 104.. figure:: plots/f-bham.* 105 :width: 8.00000cm 106 107 The Buckingham interaction. 108 109See also :numref:`Fig. %s <fig-bham>`. The force derived from this is: 110 111.. math:: \mathbf{F}_i({r_{ij}}) = \left[ A_{ij}B_{ij}\exp(-B_{ij} {r_{ij}}) - 112 6\frac{C_{ij}}{{r_{ij}}^7} \right] {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} 113 :label: eqnnbbuckinghamforce 114 115.. _coul: 116 117Coulomb interaction 118~~~~~~~~~~~~~~~~~~~ 119 120The Coulomb interaction between two charge particles is given by: 121 122.. math:: V_c({r_{ij}}) = f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}} 123 :label: eqnvcoul 124 125See also :numref:`Fig. %s <fig-coul>`, where 126:math:`f = \frac{1}{4\pi \varepsilon_0} = {138.935\,458}` (see chapter :ref:`defunits`) 127 128.. _fig-coul: 129 130.. figure:: plots/vcrf.* 131 :width: 8.00000cm 132 133 The Coulomb interaction (for particles with equal signed charge) with 134 and without reaction field. In the latter case 135 :math:`{\varepsilon_r}` was 1, :math:`{\varepsilon_{rf}}` was 78, and 136 :math:`r_c` was 0.9 nm. The dot-dashed line is the same as the dashed 137 line, except for a constant. 138 139The force derived from this potential is: 140 141.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}^2}{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} 142 :label: eqnfcoul 143 144A plain Coulomb interaction should only be used without cut-off or when 145all pairs fall within the cut-off, since there is an abrupt, large 146change in the force at the cut-off. In case you do want to use a 147cut-off, the potential can be shifted by a constant to make the 148potential the integral of the force. With the group cut-off scheme, this 149shift is only applied to non-excluded pairs. With the Verlet cut-off 150scheme, the shift is also applied to excluded pairs and self 151interactions, which makes the potential equivalent to a reaction field 152with :math:`{\varepsilon_{rf}}=1` (see below). 153 154In |Gromacs| the relative dielectric constant :math:`{\varepsilon_r}` may 155be set in the in the input for :ref:`grompp <gmx grompp>`. 156 157.. _coulrf: 158 159Coulomb interaction with reaction field 160~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 161 162The Coulomb interaction can be modified for homogeneous systems by 163assuming a constant dielectric environment beyond the cut-off 164:math:`r_c` with a dielectric constant of :math:`{\varepsilon_{rf}}`. 165The interaction then reads: 166 167.. math:: V_{crf} ~=~ 168 f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}}\left[1+\frac{{\varepsilon_{rf}}-{\varepsilon_r}}{2{\varepsilon_{rf}}+{\varepsilon_r}} 169 \,\frac{{r_{ij}}^3}{r_c^3}\right] 170 - f\frac{q_i q_j}{{\varepsilon_r}r_c}\,\frac{3{\varepsilon_{rf}}}{2{\varepsilon_{rf}}+{\varepsilon_r}} 171 :label: eqnvcrf 172 173in which the constant expression on the right makes the potential zero 174at the cut-off :math:`r_c`. For charged cut-off spheres this corresponds 175to neutralization with a homogeneous background charge. We can rewrite 176:eq:`eqn. %s <eqnvcrf>` for simplicity as 177 178.. math:: V_{crf} ~=~ f \frac{q_i q_j}{{\varepsilon_r}}\left[\frac{1}{{r_{ij}}} + k_{rf}~ {r_{ij}}^2 -c_{rf}\right] 179 :label: eqnvcrfrewrite 180 181with 182 183.. math:: \begin{aligned} 184 k_{rf} &=& \frac{1}{r_c^3}\,\frac{{\varepsilon_{rf}}-{\varepsilon_r}}{(2{\varepsilon_{rf}}+{\varepsilon_r})} 185 \end{aligned} 186 :label: eqnkrf 187 188.. math:: \begin{aligned} 189 c_{rf} &=& \frac{1}{r_c}+k_{rf}\,r_c^2 ~=~ \frac{1}{r_c}\,\frac{3{\varepsilon_{rf}}}{(2{\varepsilon_{rf}}+{\varepsilon_r})} 190 \end{aligned} 191 :label: eqncrf 192 193For large :math:`{\varepsilon_{rf}}` the :math:`k_{rf}` goes to 194:math:`r_c^{-3}/2`, while for :math:`{\varepsilon_{rf}}` = 195:math:`{\varepsilon_r}` the correction vanishes. In :numref:`Fig. %s <fig-coul>` the 196modified interaction is plotted, and it is clear that the derivative 197with respect to :math:`{r_{ij}}` (= -force) goes to zero at the cut-off 198distance. The force derived from this potential reads: 199 200.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -f \frac{q_i q_j}{{\varepsilon_r}}\left[\frac{1}{{r_{ij}}^2} - 2 k_{rf}{r_{ij}}\right]{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} 201 :label: eqnfcrf 202 203The reaction-field correction should also be applied to all excluded 204atoms pairs, including self pairs, in which case the normal Coulomb term 205in :eq:`eqns. %s <eqnvcrf>` and :eq:`%s <eqnfcrf>` is absent. 206 207.. _modnbint: 208 209Modified non-bonded interactions 210~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 211 212In |Gromacs|, the non-bonded potentials can be modified by a shift 213function, also called a force-switch function, since it switches the 214force to zero at the cut-off. The purpose of this is to replace the 215truncated forces by forces that are continuous and have continuous 216derivatives at the cut-off radius. With such forces the time integration 217produces smaller errors. But note that for Lennard-Jones interactions 218these errors are usually smaller than other errors, such as integration 219errors at the repulsive part of the potential. For Coulomb interactions 220we advise against using a shifted potential and for use of a reaction 221field or a proper long-range method such as PME. 222 223There is *no* fundamental difference between a switch function (which 224multiplies the potential with a function) and a shift function (which 225adds a function to the force or potential) \ :ref:`72 <refSpoel2006a>`. The 226switch function is a special case of the shift function, which we apply 227to the *force function* :math:`F(r)`, related to the electrostatic or 228van der Waals force acting on particle :math:`i` by particle :math:`j` 229as: 230 231.. math:: \mathbf{F}_i = c \, F(r_{ij}) \frac{\mathbf{r}_{ij}}{r_{ij}} 232 :label: eqnswitch 233 234For pure Coulomb or Lennard-Jones interactions 235:math:`F(r) = F_\alpha(r) = \alpha \, r^{-(\alpha+1)}`. The switched 236force :math:`F_s(r)` can generally be written as: 237 238.. math:: \begin{array}{rcl} 239 F_s(r)~=&~F_\alpha(r) & r < r_1 \\ 240 F_s(r)~=&~F_\alpha(r)+S(r) & r_1 \le r < r_c \\ 241 F_s(r)~=&~0 & r_c \le r 242 \end{array} 243 :label: eqnswitchforce 244 245When :math:`r_1=0` this is a traditional shift function, otherwise it 246acts as a switch function. The corresponding shifted potential function 247then reads: 248 249.. math:: V_s(r) = \int^{\infty}_r~F_s(x)\, dx 250 :label: eqnswitchpotential 251 252The |Gromacs| **force switch** function :math:`S_F(r)` should be smooth at 253the boundaries, therefore the following boundary conditions are imposed 254on the switch function: 255 256.. math:: \begin{array}{rcl} 257 S_F(r_1) &=&0 \\ 258 S_F'(r_1) &=&0 \\ 259 S_F(r_c) &=&-F_\alpha(r_c) \\ 260 S_F'(r_c) &=&-F_\alpha'(r_c) 261 \end{array} 262 :label: eqnswitchforcefunction 263 264A 3\ :math:`^{rd}` degree polynomial of the form 265 266.. math:: S_F(r) = A(r-r_1)^2 + B(r-r_1)^3 267 :label: eqnswitchforcepoly 268 269fulfills these requirements. The constants A and B are given by the 270boundary condition at :math:`r_c`: 271 272.. math:: \begin{array}{rcl} 273 A &~=~& -\alpha \, \displaystyle 274 \frac{(\alpha+4)r_c~-~(\alpha+1)r_1} {r_c^{\alpha+2}~(r_c-r_1)^2} \\ 275 B &~=~& \alpha \, \displaystyle 276 \frac{(\alpha+3)r_c~-~(\alpha+1)r_1}{r_c^{\alpha+2}~(r_c-r_1)^3} 277 \end{array} 278 :label: eqnforceswitchboundary 279 280Thus the total force function is: 281 282.. math:: F_s(r) = \frac{\alpha}{r^{\alpha+1}} + A(r-r_1)^2 + B(r-r_1)^3 283 :label: eqnswitchfinalforce 284 285and the potential function reads: 286 287.. math:: V_s(r) = \frac{1}{r^\alpha} - \frac{A}{3} (r-r_1)^3 - \frac{B}{4} (r-r_1)^4 - C 288 :label: eqnswitchfinalpotential 289 290where 291 292.. math:: C = \frac{1}{r_c^\alpha} - \frac{A}{3} (r_c-r_1)^3 - \frac{B}{4} (r_c-r_1)^4 293 :label: eqnswitchpotentialexp 294 295The |Gromacs| **potential-switch** function :math:`S_V(r)` scales the 296potential between :math:`r_1` and :math:`r_c`, and has similar boundary 297conditions, intended to produce smoothly-varying potential and forces: 298 299.. math:: \begin{array}{rcl} 300 S_V(r_1) &=&1 \\ 301 S_V'(r_1) &=&0 \\ 302 S_V''(r_1) &=&0 \\ 303 S_V(r_c) &=&0 \\ 304 S_V'(r_c) &=&0 \\ 305 S_V''(r_c) &=&0 306 \end{array} 307 :label: eqnpotentialswitch 308 309The fifth-degree polynomial that has these properties is 310 311.. math:: 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} 312 :label: eqn5polynomal 313 314This implementation is found in several other simulation 315packages,\ :ref:`73 <refOhmine1988>`\ :ref:`75 <refGuenot1993>` but 316differs from that in CHARMM.\ :ref:`76 <refSteinbach1994>` Switching the 317potential leads to artificially large forces in the switching region, 318therefore it is not recommended to switch Coulomb interactions using 319this function,\ :ref:`72 <refSpoel2006a>` but switching Lennard-Jones 320interactions using this function produces acceptable results. 321 322Modified short-range interactions with Ewald summation 323~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 324 325When Ewald summation or particle-mesh Ewald is used to calculate the 326long-range interactions, the short-range Coulomb potential must also be 327modified. Here the potential is switched to (nearly) zero at the 328cut-off, instead of the force. In this case the short range potential is 329given by: 330 331.. math:: V(r) = f \frac{\mbox{erfc}(\beta r_{ij})}{r_{ij}} q_i q_j, 332 :label: eqnewaldsrmod 333 334where :math:`\beta` is a parameter that determines the relative weight 335between the direct space sum and the reciprocal space sum and 336erfc\ :math:`(x)` is the complementary error function. For further 337details on long-range electrostatics, see sec. :ref:`lrelstat`. 338