week 2 basics of md simulations lecture 3: force fields (empirical potential functions among atoms)...
TRANSCRIPT
Week 2
Basics of MD Simulations
•Lecture 3: Force fields (empirical potential functions among atoms)
Boundaries and computation of long-range interactions
•Lecture 4: Molecular mechanics (T=0, energy minimization)
MD simulations (integration algorithms, constrained dynamics,
ensembles)
Empirical force fields (potential functions)
Problem: Reduce the ab initio potential energy surface among the atoms
ji kji
kjijii UUU ),,(),( 32 RRRRRR
To a classical many-body interaction in the form
ieji ji
jii E
ezzU R
RRR
2
Such a program has been tried for water but so far it has failed to produce a
classical potential that works. In strongly interacting systems, it is difficult to
describe the collective effects by summing up the many-body terms.
Practical solution: Truncate the series at the two-body level and assume
(hope!) that the effects of higher order terms can be absorbed in U2 by
reparametrizing it.
iiii
iii
jiji
U
R
RR
qqU
)0(
3
21
ˆ)ˆ(31
,
EE
pRRpE
Ep
RR
pol
pol
Coul
Interaction of two atoms at a distance R can be decomposed into 4 pieces
1. Coulomb potential (1/R)
2. Induced polarization (1/R2)
3. Dispersion (van der Waals) (1/R6)
4. Short range repulsion (eR/a)
The first two can be described using classical electromagnetism
1. Coulomb potential:
2. Induced polarization:
Dipole field
Total polarization int. (Initial and final E fieldsin iteration)
Non-bonded interactions
aRAeU /sr
2/)( jiijjiij
62 43 RU disp
Here corresponds to the depth of the potential at the minimum; 21/6σ
Combination rules for different atoms:
The last two interactions are quantum mechanical in origin.
Dispersion is a dipole-dipole interaction that arises from quantum
fluctuations (electronic excitations to non-spherical states)
Short range repulsion arises from Pauli exclusion principle (electron clouds
of two atoms avoid each other), so it is proportional to the electron density
The two interactions are combined using a 12-6 Lennard-Jones (LJ)
potential 6124 RRU LJ
12-6 Lennard-Jones potential (U is in kT, r in Å)
3 3.5 4 4.5 5-0.5
0
0.5
1
1.5
2
2.5
r
U(r
)
AkT 3,41
Because the polarization interaction is many-body and requires iterations,
it has been neglected in most force fields.
The non-bonded interactions are thus represented by the Coulomb and
12-6 LJ potentials.
Model RO-H (Å) HOH qH (e) (kT) (Å) (D) (T=298 C)
SPC 1.0 109.5 0.410 0.262 3.166 2.27 65±5
TIP3P 0.957 104.5 0.417 0.257 3.151 2.35 97±7
Exp. Gas 1.86 80Ab initio Water 3.00
SPC: simple point charge
TIP3P: transferable intermolecular potential with 3 points
Popular water models (rigid)
There are hundreds of water models in the market, some explicitly
including polarization interaction. But as yet there is no model that
can describe all the properties of water successfully.
SPC and TIP3P have been quite successful in simulation of biomolecules,
and have become industry standards.
However, the mean field description of the polarization interaction is bound
to break in certain situations:
1. Ion channels, cavities
2. Interfaces
3. Divalent ions
To deal with these, we need polarizable force fields.
Grafting point polarizabilities on atoms and fitting the model to data has not
worked well. Ab initio methods are needed to make further progress.
Covalent bonds
In molecules, atoms are bonded together with covalent bonds, which
arise from sharing of electrons in partially occupied orbitals. In order to
account for the dipole moment of a molecule in a classical
representation, partial charges are assigned to the atoms. If the bonds
are very strong, the molecule can be treated as rigid as in water
molecule. In most large molecules, however, the structure is quite flexible
and this must be taken into account for a proper description of the
molecules. This is literally done by replacing the bonds by springs. The
nearest neighbour interactions involving 2, 3 and 4 atoms are described
by harmonic and periodic potentials
02
02
0 cos122
ijklijkl
ijklijk
ijkijk
ijij
rij
bond nVk
rrk
U
bond stretching bending torsion (not very good)
Interaction of two H atoms in the ground (1s) state can be described
using Linear Combinations of Atomic Orbitals (LCAO)
)1()1( 21 scsc BA
)1()1(2
1ss BA
From symmetry, two solutions with lowest and highest energies are:
+ Symmetric
- Anti-symmetric
The R dependence of the potential energy is approximately given by the
Morse potential
2)( 01 RRe eDU
Morse
20 )(
21
RRkUbond
Where
De: dissociation energy
Re: equilibrium bond distance
controls the width of the potential
Classical representation:
eDk 2/
k
Electronic wave functions for the 1s, 2s and 2p states in H atom
H2 molecule:
In carbon, 4 electrons (in 2s and 2p) occupy 4 hybridized sp3 orbitals
pxpypxs
pxpypxs
pxpypxs
pxpypxs
2
1
21
21
2
1
4
3
2
1
Thus carbon needs 4 bonds to have a stable configuration.
Nitrogen has an extra electron, so needs 3 bonds.
Oxygen has 2 extra electrons, so needs 2 bonds.
Tetrahedral structure of sp3
20bend )(
21 ijkkU
Bond stretching and bending interactions are quite strong and well
determined from spectroscopy. Torsion is much weaker compared to
the other two and is not as well determined. Following QM calculations,
they have been revamped recently (e.g., CMAP corrections in the
CHARMM force field), which resulted in a better description of proteins.
For a complete description of flexibility, we need, besides bond stretching,
bending and torsion. The former can be described with a harmonic form:
0torsion cos1 ijklnVU
While the latter is represented with a periodic function
An in-depth look at the force fields
Three force fields, constructed in the eighties, have come to dominate
the MD simulations
1. CHARMM (Karplus @ Harvard)
Optimized for proteins, works well also for lipids and nucleic acids
2. AMBER (Kollman & Case @ UCSF)
Optimized for nucleic acids, otherwise quite similar to CHARMM
3. GROMOS (Berendsen & van Gunsteren @ Groningen)
Initially optimized for lipids and did not work very well for proteins
(smaller partial charges in the carbonyl and amide groups) but it has
been corrected in the more recent versions.
The first two use the TIP3P water model and the last one, SPC model.
They all ignore the polarization interaction. Polarizable versions have
been under construction for over a decade but no working code yet.
Charm parameters for alanine
Partial charge (e)
ATOM N -0.47 |
ATOM HN 0.31 HN—N
ATOM CA 0.07 | HB1
ATOM HA 0.09 | /
GROUP HA—CA—CB—HB2
ATOM CB -0.27 | \
ATOM HB1 0.09 | HB3
ATOM HB2 0.09 O=C
ATOM HB3 0.09 |
ATOM C 0.51
ATOM O -0.51
Total charge: 0.00
Bond lengths :
kr (kcal/mol/Å2) r0 (Å)
N CA 320. 1.430 (1)
CA C 250. 1.490 (2)
C N 370. 1.345 (2) (peptide bond)
O C 620. 1.230 (2) (double bond)
N H 440. 0.997 (2)
HA CA 330. 1.080 (2)
CB CA 222. 1.538 (3)
HB CB 322. 1.111 (3)
1. NMA (N methyl acetamide) vibrational spectra
2. Alanine dipeptide ab initio calculations
3. From alkanes
20)( rrkU r bond
Bond angles :
k (kcal/mol/rad2) 0 (deg)
C N CA 50. 120. (1)
C N H 34. 123. (1)
H N CA 35. 117. (1)
N CA C 50. 107. (2)
N CA CB 70. 113.5 (2)
N CA HA 48. 108. (2)
HA CA CB 35. 111. (2)
HA CA C 50. 109.5 (2)
CB CA C 52. 108. (2)
N C CA 80. 116.5 (1)
O C CA 80. 121. (2)
O C N 80. 122.5 (1)
20)( kUangle
Total 360 deg.
Total 360 deg.
Basic dihedral configurations
trans cisDefinition of the dihedral
angle for 4 atoms A-B-C-D
)cos(12 0 n
VU n
dihedDihedrals:
Dihedral parameters:
Vn (kcal/mol) n 0 (deg) Name
C N CA C 0.2 1 180.
N CA C N 0.6 1 0.
CA C N CA 1.6 1 0.
H N CA CB 0.0 1 0.
H N CA HA 0.0 1 0.
C N CA CB 1.8 1 0.
CA C N H 2.5 2 180.
O C N H 2.5 2 180.
O C N CA 2.5 2 180.
)cos(12 0 n
VU n
dihed
–helix structure
-helix
~ 57o
~ 47o
(Sasisekharan)
When one of the 4 atoms is not in a chain (e.g. O bond with C in CA-C-N),
then an improper dihedral interaction is used to constrain that atom.
Most of the time, off-the-chain atom is constrained to a plane using:
)cos(1 00 VU imp
CA
C O
N
Where is the angle C=O bond makes
with the CA-C-N plane, and = 180
which enforces a planar configuration.
Boundaries
In macroscopic systems, the effect of boundaries on the dynamics of
biomolecules is minimal. In MD simulations, however, the system size
is much smaller and one has to worry about the boundary effects.
• Using nothing (vacuum) is not realistic for bulk simulations.
• Minimum requirement: water beyond the simulation box must be
treated using a continuum representation (reaction field). An
intermediate zone is treated using stochastic boundary conditions.
• Most common solution: periodic boundary conditions.
The simulation box is replicated in all directions just like in a crystal.
The cube and rectangular prism are the obvious choices for a box
shape, though there are other shapes that can fill the space (e.g.
hexagonal prism and rhombic dodecahedron).
Periodic boundary conditions in two dimensions: 8 nearest neighbours
Particles in the box freely move to the next box, which means they
appear from the opposite side of the same box.
In 3-D, there are 26 nearest neighbours.
Treatment of long-range interactions
Problem: the number of non-bonded interactions grows as N2 where N is
the number of particles. This is the main computational bottle neck that
limits the system size. A simple way to deal with this problem is to
introduce a cutoff radius for pairwise interactions (together with a
switching function), and calculate the potential only for those within the
cutoff sphere. This is further facilitated by creating non-bonded pair lists,
which are updated every 10-20 steps.
• For Lennard-Jones (6-12) interaction, which is weak and falls rapidly,
this works fine and is adapted in all MD codes.
• Coulomb interaction, however, is very strong and falls very slowly.
[Recall the Coulomb potential between two unit charges, U=560 kT/r (Å)]
Hence use of any cutoff is problematic and should be avoided.
This problem has been solved by introducing the Ewald sum method.
All the modern MD codes use the Ewald sum method to treat the long-
range interactions without cutoffs.
Here one replaces the point charges with Gaussian distributions, which
leads to a much faster convergence of the sum in the reciprocal (Fourier)
space.
The remaining part (point particle – Gaussian) falls exponentially in real
space, hence can be computed easily using a cutoff radius (~10 Å).
The mathematical details of the Ewald sum method is given in the
following appendix. Please read it to understand how it works in practice.
N
j ij
ji
N
iii
qqU
11
')(,)(2
1
n nrrrr Coul
Appendix: Ewald summation method
The coulomb energy of N charged particles in a box of volume V=LxLyLz
Here with integer values for n.
The prime on the sum signifies that i=j is not included for n=0.
Ewald’s observation (1921): in calculating the Coulomb energy of ionic
crystals, replacing the point charges with Gaussian distributions leads to
a much faster convergence of the sum in the reciprocal (Fourier) space.
The remaining part (point particle – Gaussian) falls exponentially in real
space, hence can be computed easily.
),,( zzyyxx LnLnLnnr
rq
q )(rpoint
''
)'(4 32 rd
rr
r
For a point charge q at the origin:
function error the iswhere
GaussGauss
xu
r
r
duex
rr
qrd
eq
qrdeq
0
3'
2/3
3
32/3
3
2
22
22
2)erf(
)erf(''
)(
)(,)(
rrr
rr
The Poisson equation and it’s solution:
When the charge q has a Gaussian distribution:
)erf()(
)erf(2
'2
)(
2
14
''4'''
41
00
'
22/3
3
'2/3
3
2
2
2/3
3
2
2
222
22
22
22
rrq
rqdueqdreqr
eqrdrd
drreqdrrdr
d
eqrdr
dr
ru
rr
r
rr
r
r
r
r
This result is obtained most easily by integrating the Poisson equation
Integrate 0 to r :
)erfc()erf(1)( ijij
jij
ij
ji r
r
qr
r
q r
)( GausspointGausspoint
22re
For the second part, the potential due to a charge qj at rj is given by:
Writing the charge density as
Where erfc(x) is the complementary error function which falls as
Thus choosing 1/ about an Angstrom, this potential converges quickly.
Typically, it is evaluated using a cutoff radius of ~10 Å, so the original box
with N particles is sufficient for this purpose (with the nearest image
convention). The direct (short-range) part of the energy of the system is:
),erfc()(,)(2
1
11ij
N
j ij
ji
N
iii r
r
qqU
rrdirect
23 4
)(~)()(~k
qqrdeq i krk rk
Vi
zzyyxxi
rdeff
LnLnLnefV
f
3)()(~
,,2,)(~1
)(
rk
n
rk
rk
kkr
The Gaussian part converges faster in the reciprocal (Fourier) space
hence best evaluated as a Fourier series
The Poisson equation in the Fourier space
)(~4)(~
)(~14)(~1
2
2
kk
kkn
rk
n
rk
k
eV
eV
ii
For a point charge q at the origin:
)()(2/3
3
32/3
3
2222
22
)(~
zkykxkizyx
ir
zyxeedzdydxq
rdeeq
rkk
22 4ke
When the charge q has a Gaussian distribution:
Multiply each integral by to compete the square
Each Gaussian integral then gives
22 42
4)(~ ke
k
q k
The corresponding potential in the Fourier space
N
j
kij eeq
kj
1
42
224)(~ rkkGauss
N
j
kij
N
jj
i
N
jjV
i
N
jj
eeq
eqerd
eqerd
eq
j
j
j
j
1
4
12/3
33
)(
12/3
33
)(
12/3
3
22
22
22
22
)(~
)(
rk
rrrk
rrr
n
rk
rrr
n
n
n
k
r
space all
Gauss
Gauss
The Gaussian charge density for the periodic box
Which yields for the potential
0
422
0
)(
1,
42
1
22
22
)(~4
2
1
4
2
1
)(2
1
n
n
rrk
r
k
iN
ji
kji
N
iii
ekkV
eek
V
qU
ji
Gaussrecip
0
)(
1
42
0
2241
)(~1)(
n
rrk
n
rkkr
jiN
j
kj
i
eek
q
V
eV
GaussGauss
Transforming back to the real space
The reciprocal space (long-range) part of the system’s energy:
N
ii
N
iii
q
rqU
q
rrq
1
2
1
)(21
2)0(
)erf()(
selfself
self
Gauss
r
r
This energy includes the self-energy of the Gaussian density which needs
to be removed
So the total energy is: selfrecipdirecttotal UUUU
Molecular mechanics
Molecular mechanics deals with the static features of biomolecular
systems at T=0 K, that is, particles do not have any kinetic energy.
[Note that in molecular dynamics simulations, particles have an average
kinetic energy of (3/2)kT, which is substantial at room temp., T=300 K]
Thus the energy is given solely by the potential energy of the system.
Two important applications of molecular mechanics are:
1. Energy minimization (geometry optimization):
Find the coordinates for the configuration that minimizes the potential
energy (local or absolute minimum).
2. Normal mode analysis:
Find the vibrational excitations of the system built on the absolute
minimum using the harmonic approximation.
Energy minimization
The initial configuration of a biomolecule whether experimentally
determined or otherwise does not usually correspond to the minimum
of the potential energy function. It may have large strains in the
backbone that would take a long time to equilibrate in MD simulations,
or worse, it may have bad contacts (i.e. overlapping van der Waals
radii), which would crash the MD simulation in the first step!
To avoid such mishaps, it is a standard practice to minimize the energy
before starting MD simulations.
Three popular methods for analytical forms:
• Steepest descent (first derivative)
• Conjugate gradient (first derivative)
• Newton-Raphson (second derivative)
Steepest descent:
Follows the gradient of the potential energy function U(r1, …,rN) at each
step of the iteration
where i is the step size. The step size can be adjusted until the minimum
of the energy along the line is found. If this is expensive, a single step is
used in each iteration, whose size is adjusted for faster convergence.
• Works best when the gradient is large (far from a minimum), but tends
to have poor convergence as a minimum is approached because the
gradient becomes smaller.
• Successive steps are always mutually perpendicular, which can lead
to oscillations and backtracking.
nNini
nii
ni
ni U ),,(, 1
1 rrffrr
A simple illustration of steepest descent with a fixed step size in
a 2D energy surface (contour plots)
Conjugate gradient:
Similar to steepest descent but the gradients calculated from previous
steps are used to help reduce oscillations and backtracking
(For the first step, is set to zero)
• Generally one finds a minimum in fewer steps than steepest descent,
e.g. it takes 2 steps for the 2D quadratic function, and ~n steps for nD.
• But conjugate gradient may have problems when the initial
conformation is far from a minimum in a complex energy surface.
• Thus a better strategy is to start with steepest descent and switch to
conjugate gradient near the minimum.
nNini
ni
nin
ini
ni
nii
ni
ni U ),,(,, 121
2
11 rrff
fδfδδrr
Newton-Raphson:
Requires the second derivatives (Hessian) besides the first.
Predicts the location of a minimum, and heads in that direction.
To see how it works in a simple situation, consider the quadratic 1D
case
In general
For a quadratic energy surface, this method will find the minimum in one
step starting from any configuration.
a
b
a
baxx
f
fxx
a
bxfcbxaxxf
x 22
2
"
'
20',)(
000min
min2
0
nlk
Nkl
ni
ni
ni
ni
ni xx
U
),,(][,][ 1
211 rr
HfHrr
• Construction and inversion of the 3Nx3N Hessian matrix is
computationally demanding for large systems (N>100).
• It will find a minimum in fewer steps than the gradient-only methods in
the vicinity of the minimum.
• But it may encounter serious problems when the initial conformation
is far from a minimum.
• A good strategy is to start with steepest descent and then switch to
alternate methods as the calculations progress, so that each algorithm
operates in the regime for which it was designed.
Using the above methods, one can only find a local minimum.
To search for an absolute minimum, Monte Carlo methods are more
suitable. Alternatively, one can heat the system in MD simulations,
which will facilitate transitions to other minima.
Normal mode analysis
Assume that the minimum energy of the system is given by the 3N
coordinates, {r0i}. Expanding the potential energy around the
equilibrium configuration gives
Ignoring the constant energy, the leading term is that of a system of
coupled harmonic oscillators. In a normal mode, all the particles in the
system oscillate with the same frequency . To find the normal modes,
first express the 3N coordinates as {xi, i=1,…,3N}.
0}{
1 1
0
}{1
001
0
0
21
0})({),,(
jjji
N
i
N
jii
i
N
iiiiN
i
i
U
UUU
rrrr
rrrrr
r
r
The potential energy becomes
where the spring constants are given by the Hessian as
Introducing the 3Nx3N diagonal mass matrix M
The secular equation for the normal modes is given by
}{
2
0ixji
ij xxU
K
03
1
3
1
031 2
1),,( jjij
N
i
N
jiiN xxKxxxxU
),,,,,,,,,diag( 222111 NNN mmmmmmmmm M
022/12/1 IMKM
For a 3Nx3N matrix, solution of the secular equation will yield 3N
eigenvalues, i and the corresponding eigenvectors,
Of these, 3 correspond to translations and 3 to rotations of the system.
Thus there are 3N-6 intrinsic vibrational modes of the system.
At a given temperature T, the motion of the i’th coordinate is given by
The mean square displacement of the coordinates and atoms:
)cos()(
2/13
72 jjij
N
j jii t
m
kTtx
223
213
23
2
23
72
2
)()()()(
2
1)(
nnnn
ij
N
j jii
xxx
m
kTx
r
A simple example: normal modes of water molecule
Water molecule has 9-6=3 intrinsic vibrations, which correspond to
symmetric and anti-symmetric stretching of H atoms and bending.
Because of H-bonding, water molecules in water cannot freely rotate
but rather librate (wag or twist).
Wave numbers: 3652 cm-1 3756 cm-1 1595 cm-1 (200 cm-1~1 kT)
Excitation energies >> kT, which justifies the use of a rigid model for water.
Normal modes of a small protein BPTI (Bovine pancreatic tyripsin inhibitor)
Some characteristic frequencies (in cm-1)Stretching Bending Torsion
H-N: 3400-3500 H-C-H: 1500 C=C: 1000
H-C: 2900-3000 H-N-H: 1500 C-O: 300-600
C=C, C=O: 1700-1800 C-C=O: 500 C-C: 300
C-C, C-N: 1000-1250 S-S-C: 300 C-S: 200
Applications to domain motions of proteins
• Many functional proteins have two main configurations called, for
example, resting & excited states, or open & closed states.
• Proteins can be crystallized in one of these states – the other
configuration need to be found by other means.
• The configurational changes that connect these two states usually
involve large domain motions that could take milli to micro seconds,
which is outside the reach of current MD simulations.
• Normal mode analysis can be used to identify such collective motions
in proteins and predict the missing state that is crucial for description of
the protein function.
• Examples: 1. Gating of ion channels (open & closed states)
2. Opening and closing of gates in transporters
Molecular dynamics
In MD simulations, one follows the trajectories of N particles according
to Newton’s equation of motion:
where U(r1,…, rN) is the potential energy function consisting of bonded
and non-bonded interactions (Coulomb and LJ 6-12).
We have already discussed force fields and boundary conditions in some
detail. Here, we will consider:
• Integration algorithms, e.g., Verlet, Leap-frog
• Initial conditions and choice of the time step
• Constrained dynamics for rigid molecules (SHAKE and RATTLE)
• MD simulations at constant temperature and pressure
),,(,2
2
Niiiiii Udt
dm rrFFr
2
2
)()()(2)(
2
)()()()(
tm
tttttt
tm
tttttt
i
iiii
i
iiii
Frrr
Fvrr
2
2
)()()()(
)()()(
tm
tttttt
tm
tttt
i
iiii
i
iii
Fvrr
Fvv
Integration algorithms
Given the position and velocities of N particles at time t, a straightforward
integration of Newton’s equation of motion yields at t+t
In practice, variations of these equations are implemented in MD codes
In the popular Verlet algorithm, one eliminates velocities using the
positions at t-t,
Adding with eq. (2), yields:
(1)
(2)
This is especially useful in situations where one is interested only in the
positions of the atoms. Velocities can be calculated from
Some drawbacks of the Verlet algorithm:
• Positions are obtained by adding a small quantity (order t2) to large
ones, which may lead to a loss of precision.
• Velocity at time t is available only at the next time step t+t
• It is not self starting. At t=0, there is no position at t-t. It is usually
estimated using
)]()([1
)(
)]()([2
1)(
tttt
t
ttttt
t
iii
iii
rrv
rrv
or
tt iii )0()0()( vrr
tttttt
tm
ttttttt
iii
i
iiii
)2/()()(
)()2/()()( 2
vrr
Fvrr
tttttt
tm
ttttt
iii
i
iii
)2/()()(
)()2/()2/(
vrr
Fvv
In the Leap-frog algorithm, the positions and velocities are calculated
at different times separated by t/2
To show its equivalence to the Verlet algorithm, consider
Subtracting the two equations yields the Verlet result.
If required, velocity
at t is obtained from:)]2/()2/([
21
)( ttttt iii vvv
To iterate these equations, we need to specify the initial conditions.
• The initial configuration of biomolecules can be taken from the Protein
Data Bank (PDB) (if available).
• In addition, membrane proteins need to be embedded in a lipid bilayer.
VMD has a facility that will perform this step with minimal effort.
• All the MD codes have facilities to hydrate a biomolecule, i.e., fill the
void in the simulation box with water molecules at the correct density.
• Ions can be added at random positions. Alternatively, VMD solves the
Poisson-Boltzmann equation and places the ions where the potential
energy are at minimum.
After energy minimization, these coordinates provide the positions at t=0.
Initial velocities are sampled from a Maxwell-Boltzmann distribution:
kTvmkT
mvP ixi
iix 2exp
2)( 2
2/1
Choosing the time step:
In choosing a time step, one has to compromise between two conflicting
demands:
• In order to obtain statistically significant results and access biologically
relevant time scales, one needs long simulation times, which requires
long time steps
• To avoid instabilities, conserve energy, etc., one needs to integrate
the equations as accurately as possible, which requires using short
time steps.
System Types of motion Recom. time step (fs)
Atoms translation 10 fs
Rigid molecules … + rotation 5 fs
Flex. mol’s, rigid bonds … + torsion 2 fs
Completely flex. mol’s ….+ vibrations 1 - 0.5 fs
)(2 jiijii rrF
Constrained dynamics
MD simulations are carried out most efficiently using the 3N Cartesian
coordinates of the N atoms in the system. This is fine if there are no rigid
bonds among the atoms in the system. For rigid molecules (e.g. water),
one needs to impose constraints on their coordinates so that their rigid
geometry is preserved during the integration. This is achieved using
Lagrange multipliers. Consider the case of a rigid diatomic molecule,
where the bond length between atoms i and j is fixed at d, which imposes
the following constraint on their coordinates
The force on atom i due to this constraint can be written as
0)( 22 djiij rr
ijiijjj FrrF )(2
)]()([2)(
)()(2)(
)]()([2)(
)()(2)(
22
22
tttm
tm
tttttt
tttm
tm
tttttt
jijj
jjjj
jiii
iiii
rrF
rrr
rrF
rrr
Note that
Thus the total constraint force on the molecule is zero, and the constraint
forces do not do any work. Incorporating the constraint forces in the
Verlet algorithm, the positions of the atoms are given by
To simplify, combine the known first three term on the r.h.s. as
)]()([2
)(')(
)]()([2
)(')(
2
2
tttm
ttt
tttm
ttt
jij
jj
jii
ii
rrrr
rrrr
(1)
(2)
22
2 )]()([11
2)(')(' dtttmm
tt jiji
ji
rrrr
A third equation is given by the constraint condition
222)()()()( dtttttt jiji rrrr
Substituting eqs. (1) and (2) above yields
This quadratic equation can be easily solved to obtain the Lagrange
multiplier . Substituting back in eqs. (1) and (2), one finds the positions
of the atoms at t+t.
For a rigid many-atomic molecule, one needs to employ a constraint for
every fixed bond length and angle. (Bond and angle constraints among
three atoms (i, j, k) can be written as three bond constraints.)
Assuming k constraints in total, this will lead to k coupled quadratic
equations, which are not easy to solve.
A common approximation is to exploit the fact that is small, hence the
quadratic terms in can be neglected. This leads to a system of k linear
equations, which can be solved by matrix inversion.
In the SHAKE algorithm, a further simplification is introduced by solving
the constraint equations sequentially one by one. This process is then
iterated to correct any constraint violations that arise from the neglect of
the coupling in the constraint equations.
SHAKE is commonly used in fixing the bond lengths of H atoms.
Another well-known constraint algorithm is RATTLE, which is designed
for the velocity-Verlet integrator, where velocities as well as positions are
corrected for constraints.
MD simulations at constant temperature and pressure
MD simulations are typically performed in the NVE ensemble, where all 3
quantities are constant. Due to truncation errors, keeping the energy
constant in long simulations can be problematic. To avoid this problem,
the alternative NVT and NPT ensembles can be employed. The
temperature of the system can be obtained from the average K. E.
Thus an obvious way to keep the temperature constant at T0 is to scale
the velocities as:
)(),()( 0 tTTtvtv ii
NkTK23
Because K. E. has considerable fluctuations, this is a rather crude method.
A better method which achieves the same result more smoothly is the
Berendsen method, where the atoms are weakly coupled an external
heat bath with the desired temperature T0
If T(t) > T0 , the coefficient of the coupling term is negative, which
invokes a viscous force slowing the velocity, and vice-versa for T(t) < T0
Similarly in the NPT ensemble, the pressure can be kept constant by
simply scaling the volume. Again a better method (Langevin piston), is
to weakly couple the pressure difference to atoms using a force as in
above, which will maintain the pressure at the desired value (~1 atm).
dt
d
tT
Tm
dt
dm i
iiiiir
Fr
1)(
02
2
Monte Carlo (MC)
Metropolis algorithm:
Given N particles interacting with a potential energy function U(r1,…, rN)
Probability:
• Assume some initial configuration with energy U0
• Move the particles by small increments to new positions with energy U1
• If U1 < U0, accept the new configuration
• If U1 > U0 , select a random number r between 0 and 1, and accept the
new configuration if rkTUU /)(exp 01
kTUeP /
• Keep iterating until the minimum energy is found