This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathforcefield.tex
2733 lines (2514 loc) · 119 KB
/
forcefield.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% This file is part of the GROMACS molecular simulation package.
%
% Copyright (c) 2013, by the GROMACS development team, led by
% David van der Spoel, Berk Hess, Erik Lindahl, and including many
% others, as listed in the AUTHORS file in the top-level source
% directory and at http://www.gromacs.org.
%
% GROMACS is free software; you can redistribute it and/or
% modify it under the terms of the GNU Lesser General Public License
% as published by the Free Software Foundation; either version 2.1
% of the License, or (at your option) any later version.
%
% GROMACS is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Lesser General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public
% License along with GROMACS; if not, see
% http://www.gnu.org/licenses, or write to the Free Software Foundation,
% Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
%
% If you want to redistribute modifications to GROMACS, please
% consider that scientific software is very special. Version
% control is crucial - bugs must be traceable. We will be happy to
% consider code for inclusion in the official distribution, but
% derived work must not be called official GROMACS. Details are found
% in the README & COPYING files - if they are missing, get the
% official version at http://www.gromacs.org.
%
% To help us fund GROMACS development, we humbly ask that you cite
% the research papers on the package. Check out http://www.gromacs.org
\chapter{Interaction function and force fields\index{force field}}
\label{ch:ff}
To accommodate the potential functions used
in some popular force fields (see \ref{sec:ff}), {\gromacs} offers a choice of functions,
both for non-bonded interaction and for dihedral interactions. They
are described in the appropriate subsections.
The potential functions can be subdivided into three parts
\begin{enumerate}
\item {\em Non-bonded}: Lennard-Jones or Buckingham, and Coulomb or
modified Coulomb. The non-bonded interactions are computed on the
basis of a neighbor list (a list of non-bonded atoms within a certain
radius), in which exclusions are already removed.
\item {\em Bonded}: covalent bond-stretching, angle-bending,
improper dihedrals, and proper dihedrals. These are computed on the
basis of fixed lists.
\item {\em Restraints}: position restraints, angle restraints,
distance restraints, orientation restraints and dihedral restraints, all
based on fixed lists.
\end{enumerate}
\section{Non-bonded interactions}
Non-bonded interactions in {\gromacs} are pair-additive and centro-symmetric:
\beq
V(\ve{r}_1,\ldots \ve{r}_N) = \sum_{i<j}V_{ij}(\rvij);
\eeq
\beq
\ve{F}_i = -\sum_j \frac{dV_{ij}(r_{ij})}{dr_{ij}} \frac{\rvij}{r_{ij}} = -\ve{F}_j
\eeq
The non-bonded interactions contain a \normindex{repulsion} term,
a \normindex{dispersion}
term, and a Coulomb term. The repulsion and dispersion term are
combined in either the Lennard-Jones (or 6-12 interaction), or the
Buckingham (or exp-6 potential). In addition, (partially) charged atoms
act through the Coulomb term.
\subsection{The Lennard-Jones interaction}
\label{sec:lj}
The \normindex{Lennard-Jones} potential $V_{LJ}$ between two atoms equals:
\beq
V_{LJ}(\rij) = \frac{C_{ij}^{(12)}}{\rij^{12}} -
\frac{C_{ij}^{(6)}}{\rij^6}
\eeq
See also \figref{lj}
The parameters $C^{(12)}_{ij}$ and $C^{(6)}_{ij}$ depend on pairs of
{\em atom types}; consequently they are taken from a matrix of
LJ-parameters. In the Verlet cut-off scheme, the potential is shifted
by a constant such that it is zero at the cut-off distance.
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/f-lj}}
\caption {The Lennard-Jones interaction.}
\label{fig:lj}
\end{figure}
The force derived from this potential is:
\beq
\ve{F}_i(\rvij) = \left( 12~\frac{C_{ij}^{(12)}}{\rij^{13}} -
6~\frac{C_{ij}^{(6)}}{\rij^7} \right) \rnorm
\eeq
The LJ potential may also be written in the following form:
\beq
V_{LJ}(\rvij) = 4\epsilon_{ij}\left(\left(\frac{\sigma_{ij}} {\rij}\right)^{12}
- \left(\frac{\sigma_{ij}}{\rij}\right)^{6} \right)
\label{eqn:sigeps}
\eeq
In constructing the parameter matrix for the non-bonded LJ-parameters,
two types of \normindex{combination rule}s can be used within {\gromacs},
only geometric averages (type 1 in the input section of the force field file):
\beq
\begin{array}{rcl}
C_{ij}^{(6)} &=& \left({C_{ii}^{(6)} \, C_{jj}^{(6)}}\right)^{1/2} \\
C_{ij}^{(12)} &=& \left({C_{ii}^{(12)} \, C_{jj}^{(12)}}\right)^{1/2}
\label{eqn:comb}
\end{array}
\eeq
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):
\beq
\begin{array}{rcl}
\sigma_{ij} &=& \frac{1}{ 2}(\sigma_{ii} + \sigma_{jj}) \\
\epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2}
\end{array}
\eeq
finally an geometric average for both parameters can be used (type 3):
\beq
\begin{array}{rcl}
\sigma_{ij} &=& \left({\sigma_{ii} \, \sigma_{jj}}\right)^{1/2} \\
\epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2}
\end{array}
\eeq
This last rule is used by the OPLS force field.
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsection{\normindex{Buckingham potential}}
The Buckingham
potential has a more flexible and realistic repulsion term
than the Lennard-Jones interaction, but is also more expensive to
compute. The potential form is:
\beq
V_{bh}(\rij) = A_{ij} \exp(-B_{ij} \rij) -
\frac{C_{ij}}{\rij^6}
\eeq
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/f-bham}}
\caption {The Buckingham interaction.}
\label{fig:bham}
\end{figure}
See also \figref{bham}. The force derived from this is:
\beq
\ve{F}_i(\rij) = \left[ A_{ij}B_{ij}\exp(-B_{ij} \rij) -
6\frac{C_{ij}}{\rij^7} \right] \rnorm
\eeq
%} % Brace matches ifthenelse test for gmxlite
\subsection{Coulomb interaction}
\label{sec:coul}
\newcommand{\epsr}{\varepsilon_r}
\newcommand{\epsrf}{\varepsilon_{rf}}
The \normindex{Coulomb} interaction between two charge particles is given by:
\beq
V_c(\rij) = f \frac{q_i q_j}{\epsr \rij}
\label{eqn:vcoul}
\eeq
See also \figref{coul}, where $f = \frac{1}{4\pi \varepsilon_0} =
138.935\,485$ (see \chref{defunits})
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/vcrf}}
\caption[The Coulomb interaction with and without reaction field.]{The
Coulomb interaction (for particles with equal signed charge) with and
without reaction field. In the latter case $\epsr$ was 1, $\epsrf$ was 78,
and $r_c$ was 0.9 nm.
The dot-dashed line is the same as the dashed line, except for a constant.}
\label{fig:coul}
\end{figure}
The force derived from this potential is:
\beq
\ve{F}_i(\rvij) = f \frac{q_i q_j}{\epsr\rij^2}\rnorm
\eeq
In {\gromacs} the relative \swapindex{dielectric}{constant}
\normindex{$\epsr$}
may be set in the in the input for {\tt grompp}.
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsection{Coulomb interaction with \normindex{reaction field}}
\label{sec:coulrf}
The Coulomb interaction can be modified for homogeneous systems by
assuming a constant dielectric environment beyond the cut-off $r_c$
with a dielectric constant of {$\epsrf$}. The interaction then reads:
\beq
V_{crf} ~=~
f \frac{q_i q_j}{\epsr\rij}\left[1+\frac{\epsrf-\epsr}{2\epsrf+\epsr}
\,\frac{\rij^3}{r_c^3}\right]
- f\frac{q_i q_j}{\epsr r_c}\,\frac{3\epsrf}{2\epsrf+\epsr}
\label{eqn:vcrf}
\eeq
in which the constant expression on the right makes the potential
zero at the cut-off $r_c$. For charged cut-off spheres this corresponds
to neutralization with a homogeneous background charge.
We can rewrite \eqnref{vcrf} for simplicity as
\beq
V_{crf} ~=~ f \frac{q_i q_j}{\epsr}\left[\frac{1}{\rij} + k_{rf}~ \rij^2 -c_{rf}\right]
\eeq
with
\bea
k_{rf} &=& \frac{1}{r_c^3}\,\frac{\epsrf-\epsr}{(2\epsrf+\epsr)} \label{eqn:krf}\\
c_{rf} &=& \frac{1}{r_c}+k_{rf}\,r_c^2 ~=~ \frac{1}{r_c}\,\frac{3\epsrf}{(2\epsrf+\epsr)}
\label{eqn:crf}
\eea
For large $\epsrf$ the $k_{rf}$ goes to $r_c^{-3}/2$,
while for $\epsrf$ = $\epsr$ the correction vanishes.
In \figref{coul}
the modified interaction is plotted, and it is clear that the derivative
with respect to $\rij$ (= -force) goes to zero at the cut-off distance.
The force derived from this potential reads:
\beq
\ve{F}_i(\rvij) = f \frac{q_i q_j}{\epsr}\left[\frac{1}{\rij^2} - 2 k_{rf}\rij\right]\rnorm
\label{eqn:fcrf}
\eeq
The reaction-field correction should also be applied to all excluded
atoms pairs, including self pairs, in which case the normal Coulomb
term in \eqnsref{vcrf}{fcrf} is absent.
Tironi {\etal} have introduced a generalized reaction field in which
the dielectric continuum beyond the cut-off $r_c$ also has an ionic strength
$I$~\cite{Tironi95}. In this case we can rewrite the constants $k_{rf}$ and
$c_{rf}$ using the inverse Debye screening length $\kappa$:
\bea
\kappa^2 &=&
\frac{2 I \,F^2}{\varepsilon_0 \epsrf RT}
= \frac{F^2}{\varepsilon_0 \epsrf RT}\sum_{i=1}^{K} c_i z_i^2 \\
k_{rf} &=& \frac{1}{r_c^3}\,
\frac{(\epsrf-\epsr)(1 + \kappa r_c) + \half\epsrf(\kappa r_c)^2}
{(2\epsrf + \epsr)(1 + \kappa r_c) + \epsrf(\kappa r_c)^2}
\label{eqn:kgrf}\\
c_{rf} &=& \frac{1}{r_c}\,
\frac{3\epsrf(1 + \kappa r_c + \half(\kappa r_c)^2)}
{(2\epsrf+\epsr)(1 + \kappa r_c) + \epsrf(\kappa r_c)^2}
\label{eqn:cgrf}
\eea
where $F$ is Faraday's constant, $R$ is the ideal gas constant, $T$
the absolute temperature, $c_i$ the molar concentration for species
$i$ and $z_i$ the charge number of species $i$ where we have $K$
different species. In the limit of zero ionic strength ($\kappa=0$)
\eqnsref{kgrf}{cgrf} reduce to the simple forms of \eqnsref{krf}{crf}
respectively.
\subsection{Modified non-bonded interactions}
\label{sec:mod_nb_int}
In {\gromacs}, the non-bonded potentials can be
modified by a shift function. The purpose of this is to replace the
truncated forces by forces that are continuous and have continuous
derivatives at the \normindex{cut-off} radius. With such forces the
timestep integration produces much smaller errors and there are no
such complications as creating charges from dipoles by the truncation
procedure. In fact, by using shifted forces there is no need for
charge groups in the construction of neighbor lists. However, the
shift function produces a considerable modification of the Coulomb
potential. Unless the ``missing'' long-range potential is properly
calculated and added (through the use of PPPM, Ewald, or PME), the
effect of such modifications must be carefully evaluated. The
modification of the Lennard-Jones dispersion and repulsion is only
minor, but it does remove the noise caused by cut-off effects.
There is {\em no} fundamental difference between a switch function
(which multiplies the potential with a function) and a shift function
(which adds a function to the force or potential)~\cite{Spoel2006a}. The switch
function is a special case of the shift function, which we apply to
the {\em force function} $F(r)$, related to the electrostatic or
van der Waals force acting on particle $i$ by particle $j$ as:
\beq
\ve{F}_i = c F(r_{ij}) \frac{\rvij}{r_{ij}}
\eeq
For pure Coulomb or Lennard-Jones interactions
$F(r)=F_\alpha(r)=r^{-(\alpha+1)}$.
The shifted force $F_s(r)$ can generally be written as:
\beq
\begin{array}{rcl}
\vspace{2mm}
F_s(r)~=&~F_\alpha(r) & r < r_1 \\
\vspace{2mm}
F_s(r)~=&~F_\alpha(r)+S(r) & r_1 \le r < r_c \\
F_s(r)~=&~0 & r_c \le r
\end{array}
\eeq
When $r_1=0$ this is a traditional shift function, otherwise it acts as a
switch function. The corresponding shifted coulomb potential then reads:
\beq
V_s(r_{ij}) = f \Phi_s (r_{ij}) q_i q_j
\eeq
where $\Phi(r)$ is the potential function
\beq
\Phi_s(r) = \int^{\infty}_r~F_s(x)\, dx
\eeq
The {\gromacs} shift function should be smooth at the boundaries, therefore
the following boundary conditions are imposed on the shift function:
\beq
\begin{array}{rcl}
S(r_1) &=&0 \\
S'(r_1) &=&0 \\
S(r_c) &=&-F_\alpha(r_c) \\
S'(r_c) &=&-F_\alpha'(r_c)
\end{array}
\eeq
A 3$^{rd}$ degree polynomial of the form
\beq
S(r) = A(r-r_1)^2 + B(r-r_1)^3
\eeq
fulfills these requirements. The constants A and B are given by the
boundary condition at $r_c$:
\beq
\begin{array}{rcl}
\vspace{2mm}
A &~=~& -\displaystyle
\frac{(\alpha+4)r_c~-~(\alpha+1)r_1} {r_c^{\alpha+2}~(r_c-r_1)^2} \\
B &~=~& \displaystyle
\frac{(\alpha+3)r_c~-~(\alpha+1)r_1}{r_c^{\alpha+2}~(r_c-r_1)^3}
\end{array}
\eeq
Thus the total force function is:
\beq
F_s(r) = \frac{\alpha}{r^{\alpha+1}} + A(r-r_1)^2 + B(r-r_1)^3
\eeq
and the potential function reads:
\beq
\Phi(r) = \frac{1}{r^\alpha} - \frac{A}{3} (r-r_1)^3 - \frac{B}{4} (r-r_1)^4 - C
\eeq
where
\beq
C = \frac{1}{r_c^\alpha} - \frac{A}{3} (r_c-r_1)^3 - \frac{B}{4} (r_c-r_1)^4
\eeq
When $r_1$ = 0, the modified Coulomb force function is
\beq
F_s(r) = \frac{1}{r^2} - \frac{5 r^2}{r_c^4} + \frac{4 r^3}{r_c^5}
\eeq
which is identical to the {\em \index{parabolic force}}
function recommended to be used as a short-range function in
conjunction with a \swapindex{Poisson}{solver}
for the long-range part~\cite{Berendsen93a}.
The modified Coulomb potential function is:
\beq
\Phi(r) = \frac{1}{r} - \frac{5}{3r_c} + \frac{5r^3}{3r_c^4} - \frac{r^4}{r_c^5}
\eeq
See also \figref{shift}.
\begin{figure}
\centerline{\includegraphics[angle=270,width=10cm]{plots/shiftf}}
\caption[The Coulomb Force, Shifted Force and Shift Function
$S(r)$,.]{The Coulomb Force, Shifted Force and Shift Function $S(r)$,
using r$_1$ = 2 and r$_c$ = 4.}
\label{fig:shift}
\end{figure}
\subsection{Modified short-range interactions with Ewald summation}
When Ewald summation\index{Ewald sum} or \seeindex{particle-mesh
Ewald}{PME}\index{Ewald, particle-mesh} is used to calculate the
long-range interactions, the
short-range Coulomb potential must also be modified, similar to the
switch function above. In this case the short range potential is given
by:
\beq
V(r) = f \frac{\mbox{erfc}(\beta r_{ij})}{r_{ij}} q_i q_j,
\eeq
where $\beta$ is a parameter that determines the relative weight
between the direct space sum and the reciprocal space sum and erfc$(x)$ is
the complementary error function. For further
details on long-range electrostatics, see \secref{lr_elstat}.
%} % Brace matches ifthenelse test for gmxlite
\section{Bonded interactions}
Bonded interactions are based on a fixed list of atoms. They are not
exclusively pair interactions, but include 3- and 4-body interactions
as well. There are {\em bond stretching} (2-body), {\em bond angle}
(3-body), and {\em dihedral angle} (4-body) interactions. A special
type of dihedral interaction (called {\em improper dihedral}) is used
to force atoms to remain in a plane or to prevent transition to a
configuration of opposite chirality (a mirror image).
\subsection{Bond stretching}
\label{sec:bondpot}
\subsubsection{Harmonic potential}
\label{subsec:harmonicbond}
The \swapindex{bond}{stretching} between two covalently bonded atoms
$i$ and $j$ is represented by a harmonic potential:
\begin{figure}
\centerline{\raisebox{4cm}{\includegraphics[angle=270,width=5cm]{plots/bstretch}}\includegraphics[width=7cm]{plots/f-bond}}
\caption[Bond stretching.]{Principle of bond stretching (left), and the bond
stretching potential (right).}
\label{fig:bstretch1}
\end{figure}
\beq
V_b~(\rij) = \half k^b_{ij}(\rij-b_{ij})^2
\eeq
See also \figref{bstretch1}, with the force given by:
\beq
\ve{F}_i(\rvij) = k^b_{ij}(\rij-b_{ij}) \rnorm
\eeq
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsubsection{Fourth power potential}
\label{subsec:G96bond}
In the \gromosv{96} force field~\cite{gromos96}, the covalent bond potential
is, for reasons of computational efficiency, written as:
\beq
V_b~(\rij) = \frac{1}{4}k^b_{ij}\left(\rij^2-b_{ij}^2\right)^2
\eeq
The corresponding force is:
\beq
\ve{F}_i(\rvij) = k^b_{ij}(\rij^2-b_{ij}^2)~\rvij
\eeq
The force constants for this form of the potential are related to the usual
harmonic force constant $k^{b,harm}$ (\secref{bondpot}) as
\beq
2 k^b b_{ij}^2 = k^{b,harm}
\eeq
The force constants are mostly derived from the harmonic ones used in
\gromosv{87}~\cite{biomos}. Although this form is computationally more
efficient
(because no square root has to be evaluated), it is conceptually more
complex. One particular disadvantage is that since the form is not harmonic,
the average energy of a single bond is not equal to $\half kT$ as it is for
the normal harmonic potential.
\subsection{\normindex{Morse potential} bond stretching}
\label{subsec:Morsebond}
%\author{F.P.X. Everdij}
%
For some systems that require an anharmonic bond stretching potential,
the Morse potential~\cite{Morse29}
between two atoms {\it i} and {\it j} is available
in {\gromacs}. This potential differs from the harmonic potential in
that it has an asymmetric potential well and a zero force at infinite
distance. The functional form is:
\beq
\displaystyle V_{morse} (r_{ij}) = D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2,
\eeq
See also \figref{morse}, and the corresponding force is:
\beq
\begin{array}{rcl}
\displaystyle {\bf F}_{morse} ({\bf r}_{ij})&=&2 D_{ij} \beta_{ij} r_{ij} \exp(-\beta_{ij}(r_{ij}-b_{ij})) * \\
\displaystyle \: & \: &[1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))] \frac{\displaystyle {\bf r}_{ij}}{\displaystyle r_{ij}},
\end{array}
\eeq
where \( \displaystyle D_{ij} \) is the depth of the well in kJ/mol,
\( \displaystyle \beta_{ij} \) defines the steepness of the well (in
nm\(^{-1} \)), and \( \displaystyle b_{ij} \) is the equilibrium
distance in nm. The steepness parameter \( \displaystyle \beta_{ij}
\) can be expressed in terms of the reduced mass of the atoms {\it i}
and {\it j}, the fundamental vibration frequency \( \displaystyle
\omega_{ij} \) and the well depth \( \displaystyle D_{ij} \):
\beq
\displaystyle \beta_{ij}= \omega_{ij} \sqrt{\frac{\mu_{ij}}{2 D_{ij}}}
\eeq
and because \( \displaystyle \omega = \sqrt{k/\mu} \), one can rewrite \( \displaystyle \beta_{ij} \) in terms of the harmonic force constant \( \displaystyle k_{ij} \):
\beq
\displaystyle \beta_{ij}= \sqrt{\frac{k_{ij}}{2 D_{ij}}}
\label{eqn:betaij}
\eeq
For small deviations \( \displaystyle (r_{ij}-b_{ij}) \), one can
approximate the \( \displaystyle \exp \)-term to first-order using a
Taylor expansion:
\beq
\displaystyle \exp(-x) \approx 1-x
\label{eqn:expminx}
\eeq
and substituting \eqnref{betaij} and \eqnref{expminx} in the functional form:
\beq
\begin{array}{rcl}
\displaystyle V_{morse} (r_{ij})&=&D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2\\
\displaystyle \:&=&D_{ij} [1 - (1 -\sqrt{\frac{k_{ij}}{2 D_{ij}}}(r_{ij}-b_{ij}))]^2\\
\displaystyle \:&=&\frac{1}{2} k_{ij} (r_{ij}-b_{ij}))^2
\end{array}
\eeq
we recover the harmonic bond stretching potential.
\begin{figure}
\centerline{\includegraphics[width=7cm]{plots/f-morse}}
\caption{The Morse potential well, with bond length 0.15 nm.}
\label{fig:morse}
\end{figure}
\subsection{Cubic bond stretching potential}
\label{subsec:cubicbond}
Another anharmonic bond stretching potential that is slightly simpler
than the Morse potential adds a cubic term in the distance to the
simple harmonic form:
\beq
V_b~(\rij) = k^b_{ij}(\rij-b_{ij})^2 + k^b_{ij}k^{cub}_{ij}(\rij-b_{ij})^3
\eeq
A flexible \normindex{water} model (based on
the SPC water model~\cite{Berendsen81}) including
a cubic bond stretching potential for the O-H bond
was developed by Ferguson~\cite{Ferguson95}. This model was found
to yield a reasonable infrared spectrum. The Ferguson water model is
available in the {\gromacs} library ({\tt flexwat-ferguson.itp}).
It should be noted that the potential is asymmetric: overstretching leads to
infinitely low energies. The \swapindex{integration}{timestep} is therefore
limited to 1 fs.
The force corresponding to this potential is:
\beq
\ve{F}_i(\rvij) = 2k^b_{ij}(\rij-b_{ij})~\rnorm + 3k^b_{ij}k^{cub}_{ij}(\rij-b_{ij})^2~\rnorm
\eeq
\subsection{FENE bond stretching potential\index{FENE potential}}
\label{subsec:FENEbond}
In coarse-grained polymer simulations the beads are often connected
by a FENE (finitely extensible nonlinear elastic) potential~\cite{Warner72}:
\beq
V_{\mbox{\small FENE}}(\rij) =
-\half k^b_{ij} b^2_{ij} \log\left(1 - \frac{\rij^2}{b^2_{ij}}\right)
\eeq
The potential looks complicated, but the expression for the force is simpler:
\beq
F_{\mbox{\small FENE}}(\rvij) =
-k^b_{ij} \left(1 - \frac{\rij^2}{b^2_{ij}}\right)^{-1} \rvij
\eeq
At short distances the potential asymptotically goes to a harmonic
potential with force constant $k^b$, while it diverges at distance $b$.
%} % Brace matches ifthenelse test for gmxlite
\subsection{Harmonic angle potential}
\label{subsec:harmonicangle}
\newcommand{\tijk}{\theta_{ijk}}
The bond-\swapindex{angle}{vibration} between a triplet of atoms $i$ - $j$ - $k$
is also represented by a harmonic potential on the angle $\tijk$
\begin{figure}
\centerline{\raisebox{4cm}{\includegraphics[angle=270,width=5cm]{plots/angle}}\includegraphics[width=7cm]{plots/f-angle}}
\caption[Angle vibration.]{Principle of angle vibration (left) and the
bond angle potential (right).}
\label{fig:angle}
\end{figure}
\beq
V_a(\tijk) = \half k^{\theta}_{ijk}(\tijk-\tijk^0)^2
\eeq
As the bond-angle vibration is represented by a harmonic potential, the
form is the same as the bond stretching (\figref{bstretch1}).
The force equations are given by the chain rule:
\beq
\begin{array}{l}
\Fvi ~=~ -\displaystyle\frac{d V_a(\tijk)}{d \rvi} \\
\Fvk ~=~ -\displaystyle\frac{d V_a(\tijk)}{d \rvk} \\
\Fvj ~=~ -\Fvi-\Fvk
\end{array}
~ \mbox{ ~ where ~ } ~
\tijk = \arccos \frac{(\rvij \cdot \ve{r}_{kj})}{r_{ij}r_{kj}}
\eeq
The numbering $i,j,k$ is in sequence of covalently bonded atoms. Atom
$j$ is in the middle; atoms $i$ and $k$ are at the ends (see \figref{angle}).
{\bf Note} that in the input in topology files, angles are given in degrees and
force constants in kJ/mol/rad$^2$.
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsection{Cosine based angle potential}
\label{subsec:G96angle}
In the \gromosv{96} force field a simplified function is used to represent angle
vibrations:
\beq
V_a(\tijk) = \half k^{\theta}_{ijk}\left(\cos(\tijk) - \cos(\tijk^0)\right)^2
\eeq
where
\beq
\cos(\tijk) = \frac{\rvij\cdot\ve{r}_{kj}}{\rij r_{kj}}
\eeq
The corresponding force can be derived by partial differentiation with respect
to the atomic positions. The force constants in this function are related
to the force constants in the harmonic form $k^{\theta,harm}$
(\ssecref{harmonicangle}) by:
\beq
k^{\theta} \sin^2(\tijk^0) = k^{\theta,harm}
\eeq
In the \gromosv{96} manual there is a much more complicated conversion formula
which is temperature dependent. The formulas are equivalent at 0 K
and the differences at 300 K are on the order of 0.1 to 0.2\%.
{\bf Note} that in the input in topology files, angles are given in degrees and
force constants in kJ/mol.
\subsection{Urey-Bradley potential}
\label{subsec:Urey-Bradley}
The \swapindex{Urey-Bradley bond-angle}{vibration} between a triplet
of atoms $i$ - $j$ - $k$ is represented by a harmonic potential on the
angle $\tijk$ and a harmonic correction term on the distance between
the atoms $i$ and $k$. Although this can be easily written as a simple
sum of two terms, it is convenient to have it as a single entry in the
topology file and in the output as a separate energy term. It is used mainly
in the CHARMm force field~\cite{BBrooks83}. The energy is given by:
\beq
V_a(\tijk) = \half k^{\theta}_{ijk}(\tijk-\tijk^0)^2 + \half k^{UB}_{ijk}(r_{ik}-r_{ik}^0)^2
\eeq
The force equations can be deduced from sections~\ssecref{harmonicbond}
and~\ssecref{harmonicangle}.
\subsection{Bond-Bond cross term}
\label{subsec:bondbondcross}
The bond-bond cross term for three particles $i, j, k$ forming bonds
$i-j$ and $k-j$ is given by~\cite{Lawrence2003b}:
\begin{equation}
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)
\label{crossbb}
\end{equation}
where $k_{rr'}$ is the force constant, and $r_{1e}$ and $r_{2e}$ are the
equilibrium bond lengths of the $i-j$ and $k-j$ bonds respectively. The force
associated with this potential on particle $i$ is:
\begin{equation}
\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|}
\end{equation}
The force on atom $k$ can be obtained by swapping $i$ and $k$ in the above
equation. Finally, the force on atom $j$ follows from the fact that the sum
of internal forces should be zero: $\ve{F}_j = -\ve{F}_i-\ve{F}_k$.
\subsection{Bond-Angle cross term}
\label{subsec:bondanglecross}
The bond-angle cross term for three particles $i, j, k$ forming bonds
$i-j$ and $k-j$ is given by~\cite{Lawrence2003b}:
\begin{equation}
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)
\end{equation}
where $k_{r\theta}$ is the force constant, $r_{3e}$ is the $i-k$ distance,
and the other constants are the same as in Equation~\ref{crossbb}. The force
associated with the potential on atom $i$ is:
\begin{equation}
\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|} \\
+ \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]
\end{equation}
\subsection{Quartic angle potential}
\label{subsec:quarticangle}
For special purposes there is an angle potential
that uses a fourth order polynomial:
\beq
V_q(\tijk) ~=~ \sum_{n=0}^5 C_n (\tijk-\tijk^0)^n
\eeq
%} % Brace matches ifthenelse test for gmxlite
%% new commands %%%%%%%%%%%%%%%%%%%%%%
\newcommand{\rvkj}{{\bf r}_{kj}}
\newcommand{\rkj}{r_{kj}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Improper dihedrals\swapindexquiet{improper}{dihedral}}
\label{sec:imp}
Improper dihedrals are meant to keep \swapindex{planar}{group}s ({\eg}
aromatic rings) planar, or to prevent molecules from flipping over to their
\normindex{mirror image}s, see \figref{imp}.
\begin {figure}
\centerline{\includegraphics[angle=270,width=4cm]{plots/ring-imp}\hspace{1cm}
\includegraphics[angle=270,width=3cm]{plots/subst-im}\hspace{1cm}\includegraphics[angle=270,width=3cm]{plots/tetra-im}}
\caption[Improper dihedral angles.]{Principle of improper
dihedral angles. Out of plane bending for rings (left), substituents
of rings (middle), out of tetrahedral (right). The improper dihedral
angle $\xi$ is defined as the angle between planes (i,j,k) and (j,k,l)
in all cases.}
\label{fig:imp}
\end {figure}
\subsubsection{Improper dihedrals: harmonic type}
\label{subsec:harmonicimproperdihedral}
The simplest improper dihedral potential is a harmonic potential; it is plotted in
\figref{imps}.
\beq
V_{id}(\xi_{ijkl}) = \half k_{\xi}(\xi_{ijkl}-\xi_0)^2
\eeq
Since the potential is harmonic it is discontinuous,
but since the discontinuity is chosen at 180$^\circ$ distance from $\xi_0$
this will never cause problems.
{\bf Note} that in the input in topology files, angles are given in degrees and
force constants in kJ/mol/rad$^2$.
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/f-imps}}
\caption{Improper dihedral potential.}
\label{fig:imps}
\end{figure}
\subsubsection{Improper dihedrals: periodic type}
\label{subsec:periodicimproperdihedral}
This potential is identical to the periodic proper dihedral (see below).
There is a separate dihedral type for this (type 4) only to be able
to distinguish improper from proper dihedrals in the parameter section
and the output.
\subsection{Proper dihedrals\swapindexquiet{proper}{dihedral}}
For the normal \normindex{dihedral} interaction there is a choice of
either the {\gromos} periodic function or a function based on
expansion in powers of $\cos \phi$ (the so-called Ryckaert-Bellemans
potential). This choice has consequences for the inclusion of special
interactions between the first and the fourth atom of the dihedral
quadruple. With the periodic {\gromos} potential a special 1-4
LJ-interaction must be included; with the Ryckaert-Bellemans potential
{\em for alkanes} the \normindex{1-4 interaction}s must be excluded
from the non-bonded list. {\bf Note:} Ryckaert-Bellemans potentials
are also used in {\eg} the OPLS force field in combination with 1-4
interactions. You should therefore not modify topologies generated by
{\tt \normindex{pdb2gmx}} in this case.
\subsubsection{Proper dihedrals: periodic type}
\label{subsec:properdihedral}
Proper dihedral angles are defined according to the IUPAC/IUB
convention, where $\phi$ is the angle between the $ijk$ and the $jkl$
planes, with {\bf zero} corresponding to the {\em cis} configuration
($i$ and $l$ on the same side). There are two dihedral function types
in {\gromacs} topology files. There is the standard type 1 which behaves
like any other bonded interactions. For certain force fields, type 9
is useful. Type 9 allows multiple potential functions to be applied
automatically to a single dihedral in the {\tt [ dihedral ]} section
when multiple parameters are defined for the same atomtypes
in the {\tt [ dihedraltypes ]} section.
\begin{figure}
\centerline{\raisebox{4.5cm}{\includegraphics[angle=270,width=5cm]{plots/dih}}\includegraphics[width=7cm]{plots/f-dih}}
\caption[Proper dihedral angle.]{Principle of proper dihedral angle
(left, in {\em trans} form) and the dihedral angle potential (right).}
\label{fig:pdihf}
\end{figure}
\beq
V_d(\phi_{ijkl}) = k_{\phi}(1 + \cos(n \phi - \phi_s))
\eeq
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsubsection{Proper dihedrals: Ryckaert-Bellemans function}
\label{subsec:RBdihedral}
For alkanes, the following proper dihedral potential is often used
(see \figref{rbdih}):
\beq
V_{rb}(\phi_{ijkl}) = \sum_{n=0}^5 C_n( \cos(\psi ))^n,
\eeq
where $\psi = \phi - 180^\circ$. \\
{\bf Note:} A conversion from one convention to another can be achieved by
multiplying every coefficient \( \displaystyle C_n \)
by \( \displaystyle (-1)^n \).
An example of constants for $C$ is given in \tabref{crb}.
\begin{table}
\centerline{
\begin{tabular}{|lr|lr|lr|}
\dline
$C_0$ & 9.28 & $C_2$ & -13.12 & $C_4$ & 26.24 \\
$C_1$ & 12.16 & $C_3$ & -3.06 & $C_5$ & -31.5 \\
\dline
\end{tabular}
}
\caption{Constants for Ryckaert-Bellemans potential (kJ mol$^{-1}$).}
\label{tab:crb}
\end{table}
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/f-rbs}}
\caption{Ryckaert-Bellemans dihedral potential.}
\label{fig:rbdih}
\end{figure}
({\bf Note:} The use of this potential implies exclusion of LJ interactions
between the first and the last atom of the dihedral, and $\psi$ is defined
according to the ``polymer convention'' ($\psi_{trans}=0$).)
The RB dihedral function can also be used to include Fourier dihedrals
(see below):
\beq
V_{rb} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[F_1(1+\cos(\phi)) + F_2(
1-\cos(2\phi)) + F_3(1+\cos(3\phi)) + F_4(1-\cos(4\phi))\right]
\eeq
Because of the equalities \( \cos(2\phi) = 2\cos^2(\phi) - 1 \),
\( \cos(3\phi) = 4\cos^3(\phi) - 3\cos(\phi) \) and
\( \cos(4\phi) = 8\cos^4(\phi) - 8\cos^2(\phi) + 1 \)
one can translate the OPLS parameters to
Ryckaert-Bellemans parameters as follows:
\beq
\displaystyle
\begin{array}{rcl}
\displaystyle C_0&=&F_2 + \frac{1}{2} (F_1 + F_3)\\
\displaystyle C_1&=&\frac{1}{2} (- F_1 + 3 \, F_3)\\
\displaystyle C_2&=& -F_2 + 4 \, F_4\\
\displaystyle C_3&=&-2 \, F_3\\
\displaystyle C_4&=&-4 \, F_4\\
\displaystyle C_5&=&0
\end{array}
\eeq
with OPLS parameters in protein convention and RB parameters in
polymer convention (this yields a minus sign for the odd powers of
cos$(\phi)$).\\
\noindent{\bf Note:} Mind the conversion from {\bf kcal mol$^{-1}$} for
literature OPLS and RB parameters to {\bf kJ mol$^{-1}$} in {\gromacs}.\\
%} % Brace matches ifthenelse test for gmxlite
\subsubsection{Proper dihedrals: Fourier function}
\label{subsec:Fourierdihedral}
The OPLS potential function is given as the first three
or four~\cite{Jorgensen2005a} cosine terms of a Fourier series.
In {\gromacs} the four term function is implemented:
\beq
V_{F} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[C_1(1+\cos(\phi)) + C_2(
1-\cos(2\phi)) + C_3(1+\cos(3\phi)) + C_4(1+\cos(4\phi))\right],
\eeq
%\ifthenelse{\equal{\gmxlite}{1}}{}{
Internally, {\gromacs}
uses the Ryckaert-Bellemans code
to compute Fourier dihedrals (see above), because this is more efficient.\\
\noindent{\bf Note:} Mind the conversion from {\emph kcal mol$^{-1}$} for
literature OPLS parameters to {\bf kJ mol$^{-1}$} in {\gromacs}.\\
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsection{Tabulated bonded interaction functions\index{tabulated bonded interaction function}}
\label{subsec:tabulatedinteraction}
For full flexibility, any functional shape can be used for
bonds, angles and dihedrals through user-supplied tabulated functions.
The functional shapes are:
\bea
V_b(r_{ij}) &=& k \, f^b_n(r_{ij}) \\
V_a(\tijk) &=& k \, f^a_n(\tijk) \\
V_d(\phi_{ijkl}) &=& k \, f^d_n(\phi_{ijkl})
\eea
where $k$ is a force constant in units of energy
and $f$ is a cubic spline function; for details see \ssecref{cubicspline}.
For each interaction, the force constant $k$ and the table number $n$
are specified in the topology.
There are two different types of bonds, one that generates exclusions (type 8)
and one that does not (type 9).
For details see \tabref{topfile2}.
The table files are supplied to the {\tt mdrun} program.
After the table file name an underscore, the letter ``b'' for bonds,
``a'' for angles or ``d'' for dihedrals and the table number are appended.
For example, for a bond with $n=0$ (and using the default table file name)
the table is read from the file {\tt table_b0.xvg}. Multiple tables can be
supplied simply by using different values of $n$, and are applied to the appropriate
bonds, as specified in the topology (\tabref{topfile2}).
The format for the table files is three columns with $x$, $f(x)$, $-f'(x)$,
where $x$ should be uniformly-spaced. Requirements for entries in the topology
are given in~\tabref{topfile2}.
The setup of the tables is as follows:
\\{\bf bonds}:
$x$ is the distance in nm. For distances beyond the table length,
{\tt mdrun} will quit with an error message.
\\{\bf angles}:
$x$ is the angle in degrees. The table should go from
0 up to and including 180 degrees; the derivative is taken in degrees.
\\{\bf dihedrals}:
$x$ is the dihedral angle in degrees. The table should go from
-180 up to and including 180 degrees;
the IUPAC/IUB convention is used, {\ie} zero is cis,
the derivative is taken in degrees.
%} % Brace matches ifthenelse test for gmxlite
\section{Restraints}
Special potentials are used for imposing restraints on the motion of
the system, either to avoid disastrous deviations, or to include
knowledge from experimental data. In either case they are not really
part of the force field and the reliability of the parameters is not
important. The potential forms, as implemented in {\gromacs}, are
mentioned just for the sake of completeness. Restraints and constraints
refer to quite different algorithms in {\gromacs}.
\subsection{Position restraints\swapindexquiet{position}{restraint}}
\label{subsec:positionrestraint}
These are used to restrain particles to fixed reference positions
$\ve{R}_i$. They can be used during equilibration in order to avoid
drastic rearrangements of critical parts ({\eg} to restrain motion
in a protein that is subjected to large solvent forces when the
solvent is not yet equilibrated). Another application is the
restraining of particles in a shell around a region that is simulated
in detail, while the shell is only approximated because it lacks
proper interaction from missing particles outside the
shell. Restraining will then maintain the integrity of the inner
part. For spherical shells, it is a wise procedure to make the force
constant depend on the radius, increasing from zero at the inner
boundary to a large value at the outer boundary. This feature has
not, however, been implemented in {\gromacs}.
\newcommand{\unitv}[1]{\hat{\bf #1}}
\newcommand{\halfje}[1]{\frac{#1}{2}}
The following form is used:
\beq
V_{pr}(\ve{r}_i) = \halfje{1}k_{pr}|\rvi-\ve{R}_i|^2
\eeq
The potential is plotted in \figref{positionrestraint}.
\begin{figure}
\centerline{\includegraphics[width=8cm]{plots/f-pr}}
\caption{Position restraint potential.}
\label{fig:positionrestraint}
\end{figure}
The potential form can be rewritten without loss of generality as:
\beq
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]
\eeq
Now the forces are:
\beq
\begin{array}{rcl}
F_i^x &=& -k_{pr}^x~(x_i - X_i) \\
F_i^y &=& -k_{pr}^y~(y_i - Y_i) \\
F_i^z &=& -k_{pr}^z~(z_i - Z_i)
\end{array}
\eeq
Using three different force constants the position
restraints can be turned on or off
in each spatial dimension; this means that atoms can be harmonically
restrained to a plane or a line.
Position restraints are applied to a special fixed list of atoms. Such a
list is usually generated by the {\tt \normindex{pdb2gmx}} program.
\subsection{\swapindex{Flat-bottomed}{position restraint}s}
\label{subsec:fbpositionrestraint}
Flat-bottomed position restraints can be used to restrain particles to
part of the simulation volume. No force acts on the restrained
particle within the flat-bottomed region of the potential, however a
harmonic force acts to move the particle to the flat-bottomed region
if it is outside it. It is possible to apply normal and
flat-bottomed position restraints on the same particle (however, only
with the same reference position $\ve{R}_i$). The following general potential
is used (Figure~\ref{fig:fbposres}A):
\beq
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}],
\eeq
where $\ve{R}_i$ is the reference position, $r_\mathrm{fb}$ is the distance
from the center with a flat potential, $k_\mathrm{fb}$ the force constant, and $H$ is the Heaviside step
function. The distance $d_g(\ve{r}_i;\ve{R}_i)$ from the reference
position depends on the geometry $g$ of the flat-bottomed potential.
\begin{figure}
\centerline{\includegraphics[width=10cm]{plots/fbposres}}
\caption{Flat-bottomed position restraint potential. (A) Not
inverted, (B) inverted.}
\label{fig:fbposres}
\end{figure}
The following geometries for the flat-bottomed potential are supported:\newline
{\bfseries Sphere} ($g =1$): The particle is kept in a sphere of given
radius. The force acts towards the center of the sphere. The following distance calculation is used:
\beq
d_g(\ve{r}_i;\ve{R}_i) = |\ve{r}_i-\ve{R}_i|
\eeq
{\bfseries Cylinder} ($g=2$): The particle is kept in a cylinder of given radius
parallel to the $z$-axis. The force from the flat-bottomed potential acts
towards the axis of the cylinder. The $z$-component of the force is zero.
\beq
d_g(\ve{r}_i;\ve{R}_i) = \sqrt{ (x_i-X_i)^2 + (y_i - Y_i)^2 }
\eeq
{\bfseries Layer} ($g=3,4,5$): The particle is kept in a layer defined by the
thickness and the normal of the layer. The layer normal can be parallel to the $x$, $y$, or
$z$-axis. The force acts parallel to the layer normal.\\
\beq
d_g(\ve{r}_i;\ve{R}_i) = |x_i-X_i|, \;\;\;\mbox{or}\;\;\;
d_g(\ve{r}_i;\ve{R}_i) = |y_i-Y_i|, \;\;\;\mbox{or}\;\;\;
d_g(\ve{r}_i;\ve{R}_i) = |z_i-Z_i|.
\eeq
It is possible to apply multiple independent flat-bottomed position
restraints of different geometry on one particle. For example, applying
a cylinder and a layer in $z$ keeps a particle within a
disk. Applying three layers in $x$, $y$, and $z$ keeps the particle within a cuboid.
In addition, it is possible to invert the restrained region with the
unrestrained region, leading to a potential that acts to keep the particle {\it outside} of the volume
defined by $\ve{R}_i$, $g$, and $r_\mathrm{fb}$. That feature is
switched on by defining a negative $r_\mathrm{fb}$ in the
topology. The following potential is used (Figure~\ref{fig:fbposres}B):
\beq
V_\mathrm{fb}^{\mathrm{inv}}(\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}|)].
\eeq
%\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsection{Angle restraints\swapindexquiet{angle}{restraint}}
\label{subsec:anglerestraint}
These are used to restrain the angle between two pairs of particles
or between one pair of particles and the $z$-axis.
The functional form is similar to that of a proper dihedral.
For two pairs of atoms:
\beq
V_{ar}(\ve{r}_i,\ve{r}_j,\ve{r}_k,\ve{r}_l)
= k_{ar}(1 - \cos(n (\theta - \theta_0))
)
,~~~~\mbox{where}~~
\theta = \arccos\left(\frac{\ve{r}_j -\ve{r}_i}{\|\ve{r}_j -\ve{r}_i\|}
\cdot \frac{\ve{r}_l -\ve{r}_k}{\|\ve{r}_l -\ve{r}_k\|} \right)
\eeq
For one pair of atoms and the $z$-axis:
\beq
V_{ar}(\ve{r}_i,\ve{r}_j) = k_{ar}(1 - \cos(n (\theta - \theta_0))
)
,~~~~\mbox{where}~~
\theta = \arccos\left(\frac{\ve{r}_j -\ve{r}_i}{\|\ve{r}_j -\ve{r}_i\|}
\cdot \left( \begin{array}{c} 0 \\ 0 \\ 1 \\ \end{array} \right) \right)
\eeq