Molecular dynamics
Download
Report
Transcript Molecular dynamics
Molecular
dynamics:
Basic ideas
1
Newton’s equations of motion
Molecular dynamics (MD) can be discussed in very
general form – here, the discussion is kept simple to
stress its central ideas.
The equations of motion are the central equations in
MD. The following equations apply to each molecule i:
2
Newton’s equations of motion
Molecular dynamics (MD) can be discussed in very
general form – here, the discussion is kept simple to
stress its central ideas.
The equations of motion are the central equations in
MD. The following equations apply to each molecule i:
d ri
vi
dt
3
Newton’s equations of motion
Molecular dynamics (MD) can be discussed in very
general form – here, the discussion is kept simple to
stress its central ideas.
The equations of motion are the central equations in
MD. The following equations apply to each molecule i:
d ri
vi
dt
d vi
dt
F
i ,m
m
mi
4
Newton’s equations of motion
Molecular dynamics (MD) can be discussed in very
general form – here, the discussion is kept simple to
stress its central ideas.
The equations of motion are the central equations in
MD. The following equations apply to each molecule i:
d ri
vi
dt
d vi
dt
F
m
mi
i ,m
F
m
i ,m
Summation of
all forces
acting on
particle i.
5
The numerical problem
Assuming the molecules are spherical:
Each position vector has 3 components.
Each velocity vector has 3 components.
In a system with n molecules, there are 6n ordinary
differential equations that need to be solved
simultaneously.
It is an initial value problem: the positions and
velocities need to be known at the initial time to
proceed with integration.
6
Future concerns
We will need to take precautions if we want all the states
to be of same temperature. We will discuss this in the
future.
If the particles are not spherical, things get more
complicated.
There are numerical methods tailored to this type of
application for maximum numerical efficiency.
If the number of molecules is large, many will be too far
away from one another – how to reduce the
computational load in a meaningful way.
How to avoid the effect of borders on simulation results?
7
Equations of motion
d ri
vi
dt
d vi
dt
F
i ,m
m
mi
We will assume a system of identical molecules
whose energy of interaction is given by the LennardJones potential:
U rij 4
rij
rij
, : energy and size parameters
12
6
rij : intermolecular distance
8
How particles interact
Lennard-Jones potential
9
Intermolecular forces
The force acting in particle i as result of its interaction
with particle j is given by:
F ij U rij
Fij
dU rij
drij
rij
r ij r i r j
rij
r
ix
rjx riy rjy riz rjz
2
2
(in Cartesian coordinates)
2
10
Intermolecular forces
rij
rix
r
ij
rij
riy
rij
riz
rij
r
ix
rjx riy rjy riz rjz r
2
2
2
2 12
ij
11
Intermolecular forces
2 12
2
r
r
rij ij 1 2 1 2 ij
rij
rix
rix rix 2
1
2r
r
2
ij
2 12
ij
rix
1 r
2rij rix
2
ij
12
Intermolecular forces
rij2
rix
rix rjx riy rjy riz rjz
2
2
rix
2
2r r
ix
jx
Then:
rij
rix
1 r 1
rix rjx
rij
2rij rix
2
ij
13
Intermolecular forces
rij 1
rix rjx
rix rij
rij
rix
rij r ij
rij
riy rij
rij
riz
1 dU rij
Fij
r ij
rij drij
14
Example: Lennard-Jones in one-dimension
Assume all molecules are along a straight horizontal line.
Also, assume left-to-right is the positive direction for
coordinates and forces.
1 dU rij
Fij
r ij
rij drij
15
Example: Lennard-Jones in one-dimension
1 dU rij
Fij
r ij
rij drij
Assume r is such that:
ij
• there is attraction between molecules i and j:
• molecule i is to the right of particle j:
dU rij
drij
0
r ij ri rj 0
• Then: Fij 0 , i.e., attraction pulls particle i to the left.
16
Example: Lennard-Jones in one-dimension
1 dU rij
Fij
r ij
rij drij
Similar analysis shows that:
• Attraction pulls particle j to the right.
17
Summary
By now, we know:
•The equations we need to solve: Newton’s equation of
motion;
•How to evaluate intermolecular forces using LennardJones potential.
18
Practical difficulty
The forces, distances, and time scales in molecular
simulations are very small numbers when S.I. units
are used.
Such small numbers are a potential source of
difficulty in molecular simulations because they may
give origin to “underflows” or “overflows”: numbers
that either too small or too large to be represented in
a computer program.
It is common to rewrite the equations in terms of
dimensionless quantities.
19
Equations of motion in dimensionless form
Dimensionless quantities are defined as follows:
t
t
t m t
m
U
r
U
r
U U
r r
20
Equations of motion in dimensionless form
Equations of motion:
i
i
i
mi
d ri
dr
dr
dr
vi
vi vi
vi
dt mi dt
dt
dt
i
dv
mi dt
F
m
mi
i ,m
i
dv
dt
m
i
i
i
dv
F
F
i ,m
i ,m
dt
m
i
dv
d v mi
dv
ai
ai
Equivalently:
ai
mi dt
dt
dt
21
Equations of motion in dimensionless form
Lennard-Jones potential and force:
U rij 4
rij
12
rij
6
U r
1 12 1 6
ij
U 4
rij rij
U rij
d
r
1
1 dU
ij
F ij F ij
F ij
r ij
rij drij
rij d rij
22
Equations of motion in dimensionless form
Lennard-Jones potential and force:
d r
4
F ij
rij
r
12
ij
6
ij
ij
dr
r
ij
4
13
7
12 rij 6 rij r ij
rij
2r
r
24
2
ij
12
ij
r
6
ij
r
ij
23
Look again…
i
i
dv
F i ,m
dt
m
dr
vi
dt
1 12 1 6
U 4
rij rij
ij
F
2r
r
24
2
ij
12
ij
r
6
ij
The Lennard-Jones parameters of a specific
substance do not appear. Integration of these
equations gives general results, applicable to any
substance modeled by the Lennard-Jones potential:
an additional advantage of the dimensionless form.
r
24
ij
Summary
The equations inside colored boxes in the previous
slide are the practical equations to implement and
solve.
25
Homework questions
1) Obtain the dimensionless form of the kinetic energy of a
molecule.
2) Using dimensionless quantities, do we get meaningful
results by adding the dimensionless potential
intermolecular energies and dimensionless kinetic
energies?
3) In a simulation with argon, the dimensionless simulated
time is 100 units. What is the simulated time in seconds?
Argon data:
kB
119.8 K
2
kg
.
m
k B 1.3806503 10 23 2
s .K
3.405 1010 m
M 0.03994 kg mol
26
How does the simulation work?
1) Assign initial position and initial velocity to each particle;
2) Call numerical procedure that will integrate the
differential equations of motion:
a. Compute resulting force acting in each particle;
b. Compute the new position and velocity of each
particle;
3) After integration from the initial to the final simulated
time, analyze the results (plotting, energy conservation,
etc…).
27
Future concerns
We will need to take precautions if we want all the states to
be of the same temperature. We will discuss this in the future
If the particles are not spherical, things get more complicated
There are numerical methods tailored to this type of
application for maximum numerical efficiency
If the number of molecules is large, many will be too far away
from one another – how to reduce the computational load in a
meaningful way
How to avoid the effect of borders on simulation results?
28
Numerical integration may be troublesome
Many algorithms for integrating ordinary differential
equations are not suitable: not accurate enough
This is a system of constant total energy – it has to be
preserved during the simulation – this is a way of
checking the simulation is proceeding well
A good algorithm is called velocity Verlet
29
Velocity Verlet algorithm
Using the current state of the system:
Compute the intermolecular distances, forces, and
accelerations;
The positions at t+dt are:
1 2
r t t r t t v t t a t
2
Using the new positions, compute the forces and
accelerations:
1
v t t v t t a t a t t
2
The new position becomes the current position
30
Future concerns
We will need to take precautions if we want all the states
to be of same temperature. We will discuss this in the
future.
If the particles are not spherical, things get more
complicated.
There are numerical methods tailored to this type of
application for maximum numerical efficiency.
If the number of molecules is large, many will be too far
away from one another – how to reduce the
computational load in a meaningful way.
How to avoid the effect of borders on simulation results?
31
Periodic boundary conditions
What to do if a particle leaves the box as it moves?
32
Periodic boundary conditions
To avoid the effect of borders on simulation results,
surround the system by replicas of itself
33
Periodic boundary conditions
If a molecule leaves the system, another enters from
the opposite side
34
Periodic boundary conditions
Each particle interacts with the nearest replica of its
neighbors
35
Radial distribution function
Molecular simulations provide a lot of information that
we will uncover as we discuss more of the
fundamentals of statistical thermodynamics
One type of information – the radial distribution
function – has to do with the structure of the
substance being simulated
Formal definitions apart, the radial distribution
function gives information about the average
population of neighboring molecules as function of
the intermolecular distance to a central molecule
36
Radial distribution function
To evaluate it via molecular simulation, one splits the
space around each central molecule in spherical
concentric shells and counts how many neighboring
particles have their center there.
Image source: http://rheneas.eng.buffalo.edu/w/images/e/e0/LJ_Rdf_shell_t.GIF
37
Radial distribution function
The radial distribution function is the probability of
finding the center of a neighboring molecule at a
certain distance from the central molecule divided by
the same probability for an ideal gas of same density
38
Radial distribution function
T
Lennard-Jones fluid. Image source: Wikipedia
k BT
0.71
3 0.844
39