Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

• Averages in MD

• Periodic boundary conditions


• The meaning of cutoff distance
• Simulation of density and solubility
parameter of a polymer using the Dreding
X6 Force Field
What is an ENSEMBLE
• An ensemble is formed by a set of configurations (=microscopic box formed
by N molecules, specified by 6N variables=3N coordinates (x,y,z)+3N
velocities (vx, vy, vz)) that all satisfy certain macroscopic constraints:
– NVE ensemble is formed by all possible configurations of N molecules with total
energy E and total volume V. (MICROCANONICAL ENSEMBLE)
– NVT ensemble is formed by all possible configurations of N molecules with
temperature T and total volume V. (CANONICAL ENSEMBLE)
– NPT ensemble is formed by all possible configurations of N molecules with
temperature T and pressure p.
- mVT ensemble is formed by all possible configurations of molecules with
chemical potential m, temperature T, total volume V. (N Not fixed) (GRAND
CANONICAL ENSEMBLE) useful for phase equilibria
• The several configurations belonging to a same ensemble are, in general,
not distributed evenly, i.e. they are not all equally probable.
Probability functions

• Usually, the higher the energy of a certain configuration in


an ensemble, the lower its probability to occur.
• In the microcanonical (NVE) ensemble, all configurations
have the same energy E, and the same probability to occur.
• In the canonical NVT ensemble the probability follows
Boltzmann’s distribution law
(relative) PROBABILITY of configuration i
exp bEi 
• Inversely proportional to its energy Ei and Pi,NVT 
to temperature T  exp bE 
j
j
• Normalized over the probability of all other
particlesSiPi=1If we span the whole exp    E  X  
configuration space we find somewhere  NVT  X  
the state X of the system  exp    E  X   d 6N
X
Probability functions
p2
E  kinetic energy(p)+ potential energy(r)= (p, r)   V (r)
2m

p= momenta
r= positions
d E (X )  E  E= total energy=Hamiltonian H

exp bE 

exp b E  pV 

exp b E  mN 
How we calculate average properties
• In molecular simulations, the macroscopic values of a
thermodynamic property A are averages of microscopic
quantities.
• In MD, usually we compute time averages of the
instantaneous values of A, that depend on the microstate X
(positions and momenta of all atoms )
t t
1
A t  lim  AX(t)dt with X(t) = x1, y1, z1,..., x N , yN , z N ,..., m1vx 1, m1vy 1, m1vz 1,...mN vxN , mN vyN , mN vzN 
t  t
t 0

• In other types of molecular simulations, like the


statistical ones (MonteCarlo), there is no time. We have
a set of configurations (microstates generated via an
algorithm, which respect a constraint (NVT, NPT, etc..))
and mimic the probability density of “real” systems. Here
we can compute ensemble averages.
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Time average vs. ensemble average
t 
1
 A X(t) dt
Time average of A
A t  lim
   t 0

Ensemble average of A A(t )   X (t )


  A( X )   X (t )  dX
(pr. density-weighted
X space
average)

E.g.: Probability density


 NVT  X (t )  
exp   E  X (t )   
function in the NVT
ensemble exp   E  X (t )  dX   
Ensemble  A( X (t )) exp   E  X (t )   dX
A(t ) 
 exp   E  X (t )   dX
average of A in NVT

NVT ensemble
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Operatively…

Simulations do not generally provide Time- average <A>t(MD approach)


analytical functions: they rather allow to follow the time evolution of the
generate ensemble microstates and system (a movie) and average over
compute ensemble averages or time the time duration of the movie
averages (follow a single system over a
trajectory of fixed NVT (or NPT, ..)).
Ensemble average <A>S: (MC
approach): build a set of micro
systems in the same macroscopic
thermodynamic state (e.g. same
values of NVT, NPT etc) and
average A over them (They are
already distributed according to the
correct probability density if the
method has worked well)
Ergodic theorem

t 
1
Phase average of A
A t  lim
    A X(t) dt
t 0

A(t )   X (t )
  A( X )   X (t )  dX
Time average of A
X space

The system is ergodic if:


i) for all A(X) the time average exists for almost all X(t0)
ii) when it exists the time average is equal to the phase average
A t
 A S
.
Liquids are ergodic systems, glasses aren’t
For this reasons, glasses are better simulated with MC than MD
Pressure as an ensemble average

•The pressure is usually calculated from simulations by use of


the virial theorem, where Fint are the forces due to interactions
between one particle i and all the other ones.

1 1
VIRIAL THEOREM p   k BT  
3 V i 1... N
ri  Fiint

• The pressure is expressed in terms of density, temperature


and intermolecular forces and positions: it is valid in any
ensemble where the number of molecules N is constant
(microcanonical, canonical, isothermal, isobaric)
Periodic Boundary conditions
-Molecular simulations are carried out on boxes formed by N particles.
- Due to computer limits, N is still small compared to the “thermodynamic
limit”, in which our system accurately mimics a continuum phase.
- In small systems, the interfacial forces play a strong role, because the
fraction of particles that is on the edge is too high compared to a large
system.(Fraction of particles that is on the surface proportional to N-1/3)
- We can’t risk that the particles in the box do not behave like BULK
particles, but like interfacial ones, which are subject to different forces
- We build a larger system as an infinite periodic lattice of identical boxes
(replicas of the original box).

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Periodic Boundary conditions

• With this “trick”


• the calculation is still carried out only on N particles (to limit CPU
effort),
• the system in the box does not feel on the border (“Truman show”
effect) but like being surrounded by other particles (behaves like a
bulk particle and not like an interfacial particle)
• When an atom moves outside the edge, it appears on the other side
(to keep N fixed in each box)asteroids)
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Cutoff distance for nonbonded interactions

• In principle, a certain particle in the box interacts with all


other particles in the infinite periodic systemwe would
need to calculate an infinite number of energetic
inetractions between pairs of particles !!
• We avoid it and truncate (impose zero) all nonbonded
interactions beyond a certain cutoff distance
• This is motivated by the fact that Nonbonded interactions
(Coulomb, Van der Waals) decay to zero above a certain
distance

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Cut off distance

• Atoms that are far apart more than the cut off
distance are assumed not to interact at all.
• Cutoff distance can be set to 9-12 Angstroms.

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Calculating the density and
solubility parameter for
amorphous polymethacrylate
using LAMMPS and the
DreidingX6 force field

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Dreiding Force Field
http://www.wag.caltech.edu/publications/sup/pdf/256.pdf

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Dreiding Force Field
Is a generic FF for organic, biological
and main-group inorganic molecules.
Bonded terms:
•Harmonic/morse function for bond
stretching
•Harmonic cosine function for torsional
and inversion
NonBonded Van der Waals interactions:
•Lennard Jones (LJ) 12-6 potential
OR (in Dreiding X6)
• an exponential 6 (X6) function: gives
better description of LJ of short-range
although heavier computationally

z is a dimensionless parameter:
r  R R0
z =12 gives the same long range attraction as LH
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Build the polymer chain
•Create a new project with a new model (CTRL +N).
•Rename both the project and the model to pma.
•Build the polymer chain:
•click on Builders|Polymer builder.
•In the Monomer pull-down menu select Methyl
acrylate,
•in the Number field enter 75
•switch from isotactic to atactic.
•Leave the Number of chains and Number of
repetitions at 1. Click OK.
•The dialog closes and the pma chain appears in the
model window.
•Now you need to assign a force-field to the system. Click
on Assign force field icon in the Toolbar.
•Select the Dreiding force field. Click OK. The dialog closes.
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Generate a polymer chain box

•Open the Amorphous builder. Make sure that the


correct project and model name appear in the
Amorphous builder dialog.
•Leave all defaults as they are, except that
the Density should be changed to 1.22
g/cm3 (experimental value) and in the Options tab
click off Create new project. Then click Build.
•A new model in the same project appears,
called Amorphous model. Click on Cancel to
close.
•Rename the model name to am_pma and open
the Model viewer on this model (while the mouse
cursor is on the name of the model do a right click
to open the context menu).

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Generate a polymer chain box with Am.Bu.

•Click on Modify cell button and in the dialog check Map atoms
into cell. The model you get should look similar than the one
pictured below (in CPK style). Uncheck this option, click on OK to
apply the option and close the dialog.

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Next steps

1) Run a geometry optimization calculation in order to relax


the start structure using the same force field as in the
building process. (Dreiding)
2) Assign the DreidingX6 force field and minimize again.
3) Perform the molecular dynamics calculations, first in
the NVT ensemble to relax the system followed by
an NPT simulation to determine density and solubility
parameter.

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Geometry optimization with Dreiding

•Select am_pma model in the Project manager, right


click and select LAMMPS.
•In the Type of calculation menu select Geometry
optimization. Click Next
•Set the Cutoff to 9 Å (this value should be used
through all the example).
•Click Next to the Geometry optimization page and
leave everything at default.
•In the Output page click on Finish button to start
the calculation.
•When asked Start LAMMPS now ? press Yes.
(estimated time: 15 s)
•Click on the am_pma (output) graph and select the
icon Show Trajectory graph in the toolbar you will
see the optimization process tracked by the energy
of the box (it should decrease to a constant value)

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Geometry optimization with Dreiding X6

•Now assign a new force-field to the system. Click on Assign force


field and from the pull-down menu select the DreidingX6 force field.
Click OK. The dialog closes.
•Now follow the same minimization procedure as described above,
but in the General setup page change Name of
Job to bu_pma_opt.
•The results will appear in a new experiment level called LAMMPS
geometry optimization <2>. After having loaded the model the
model bu_pma_opt (output) appears.

431- 78648 Laboratory of Molecular Design and


Materials Simulation
MD NVT Run setting

Since we have a complex polymer structure and we are using an accurate long
range treatment for electrostatics, these calculations can last up to 2 hours.
•Make sure that the structure which corresponds to the results model is the last
obtained at the geometry optimization: deploy the Conformations level and click to
select the last one. Then reduce the bu_pma_opt (output) tree.
•Select bu_pma_opt (output) in the Project manger and do a right click to open
the context menu. Select LAMMPS.
•Change Name of job to bu_pma_nvt, leave Molecular dynamics as Type of
calculation and select the NVT ensemble. Click Next .
•In the Non-bond interactions page, set the Cutoff to 9 Å,
•click on For Coulomb interaction use and select Particle mesh in the pull-down
menu. Click Next.
The Molecular dynamics page appears. Leave all default parameters and click
on Next to continue.
In the following Temperature control page again leave everything at default and
click Next. In the Output page set the Write trajectory to file every to 1000 time
steps. Click on Finish to submit the calculation. A dialog box will appear and ask
you if you want to start the calculation now. Click Yes.
431- 78648 Laboratory of Molecular Design and
Materials Simulation
MD NVT Run-results

A new experiment level appears in the Project manager with the name LAMMPS
MD calculation. Under this level the result level of the simulation indicated by the
name Result for bu_pma_nvt. In this level there is already the input
structure bu_pma_nvt (input) and the Data files level.
You can view the progress of the calculation by using Tools | Job manager.
When the job is completed load the results of the molecular dynamics calculation.
In the Frames dialog uncheck Calculate bonds. A new model calledbu_pma_nvt
(output) is generated.
You can now animate the trajectory by clicking on the Animate trajectory button in
the Toolbar. The evolution of the total energy and its components can be viewed by
clicking on the Show trajectory graph button in the Toolbar. The final structure of
the simulation should look like this:

431- 78648 Laboratory of Molecular Design and


Materials Simulation
MD NVT Run-results

TOTAL ENERGY evolution PRESSURE evolution

Should decrease to a constant value

431- 78648 Laboratory of Molecular Design and


Materials Simulation
MD NVT Run-results

Temperature Total Volume is constant by


assumption

Of course must oscillate around a


constant value (thermostat is used)
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Setting up MD NPT Run

•This calculation was performed to relax the polymer structure, now we will do a
final MD run, in the NPT ensemble, using the equilibrated amorphous structure
from the NVT molecular dynamics run.
•Select bu_pma_nvt (output) in the Project manager and Select LAMMPS.
Change Name of job to bu_pma_npt, in the Type of calculation pull-down
menu select Molecular dynamics as type of calculation and use the NPT
ensemble. Click on Next button.
•In the Non-bond interactions page, set the Cutoff to 9 Å and click on For
Coulomb interaction use and in the pull-down menu select Particle mesh.
Check also the option Calculate intermolecular interactions. Click Next.
The Molecular dynamics page appears. Leave all default and click on Next to
continue.
In the Temperature control and Pressure control pages again leave
everything at default and click Next on both pages. In the Output page set the
Write trajectory to file every to 1000 time steps.
Click on Finish to submit the calculation. A dialog box will appear and ask you if
you want to start the calculation now. Click Yes. The simulation will start now.

431- 78648 Laboratory of Molecular Design and


Materials Simulation
NPT MD Run results

Note that a new experiment level appears in the Project


manager indicated by and that it carries the
name LAMMPS MD calculation <2>. Under this level
the result level Result for bu_pma_npt. In this level
there is already the input structure bu_pma_npt
(input) and the Data files level.
When the job is completed load the results of the
molecular dynamics calculation. In
the Frames uncheck Calculate bonds.
By clicking on the Show trajectory graph button in the
Toolbar you will see the evaluation of the energy
displayed. In the graph context menu you can select to
display the density. This graph should like the one below.
431- 78648 Laboratory of Molecular Design and
Materials Simulation
NPT MD Run results

TOTAL ENERGY INTERMOLECULAR ENERGY


(Coulomb+VDW)

431- 78648 Laboratory of Molecular Design and


Materials Simulation
NPT MD Run results

VOLUME

431- 78648 Laboratory of Molecular Design and


Materials Simulation
Calculate the solubility parameter and the density
In order to calculate the solubility parameter δ we need to estimate the volume (V) of
the system and the intermolecular energy (Ei) (averages over an interval of the
trajectory for which we observe a convergence)
Ei The factor 6947.28 converts into the commonly used (J/cm3)1/2
di  6947.28
V
Now calculate averages via the Statistics dialog
that opens through the option Statistics ... by
right clicking in the graph context menu.
Averages can be computed only for properties
that are displayed in the graph. In our case make
first sure that the Volume is displayed in the
graph, then call the Statistics dialog. In the pull
down menu select Volume and in the Start field
give the first frame of the interval considered,
leave End at its value,101, and click Calculate.
Write down the mean value of the Volume
8711.36 A3
431- 78648 Laboratory of Molecular Design and
Materials Simulation
Calculate the average intermolecular energy
From within the inter section of the graph context menu select to display the
intermolecular energy. Now calculate its average as we did before for the volume
and write down the mean value. The values should be about<V>=8711.36
Å 3 and <Ei>=-253.716 (in the tutorial -450) kcal/mol, of course in your case these
values may be different due to fluctuations.

Applying the formula above yields a value for the solubility parameter, δ =
18.5 (J/cm3)1/2. The experimental solubility parameter for amorphous PMA is in the
range 19.9 to 21.3(J/cm3)1/2 (van Krevelen, 1990). Please note that the predicted
value deviates less than 7 % from the experimental value. In order to have an even
better agreement with the experimental value should run a longer NPT simulation in
order to better converge <Ei> and <V> and reduce the error on their values.
Now display the density and calculate the average over the same interval. The
average value should <ρ>=1.22 g/cm3 and a deviation of 0.016 which is in perfect
agreement with the experimental value.

431- 78648 Laboratory of Molecular Design and


Materials Simulation

You might also like