Professional Documents
Culture Documents
Molecular Dynamics Simulation of A Lennard Jones Model System
Molecular Dynamics Simulation of A Lennard Jones Model System
December 2021
1 Introduction
Computer simulation methods provide an alternative approach, other than
experimental and analytical approaches, to study and understand various
physical phenomena. These methods have a strong foundation from Classical
Mechanics, Electrodynamics, Statistical Physics and Quantum Mechanics.
In this lab you will be studying the phase behaviour of one of the most
widely used model system (Lennard-Jones System) using classical Molecular
Dynamics (MD) simulation.
1
the equilibrium state we perform the actual measurement of the quantities
of interest.
MD Program: A simple MD program can be constructed as follows:
1. Read in the parameters that specify the conditions of the in-silico ex-
periment (e.g., initial temperature, number of particles, density, time
step for numerical integration of Newton’s equation of motion etc.,).
2. Initialize the system defining the initial positions and velocities. The
positions can be initialized either as a crystal (periodic) or as a dis-
ordered (random) system. Initial velocity can be obtained from the
Maxwell-Boltzmann distribution (at a chosen T).
where rij is the distance between any two particles i and j, σij is the
diameter of a particle, ϵ is the depth of the potential. The interaction
potential is truncated at rc = 2.5σij , beyond which U (rij ) = 0 (see Fig.
1).
6. Once the system reaches an equilibrium state, after simulating for suf-
ficient amount of time, we compute the physical observable.
In this lab you will provided with the program [3] that performs MD simu-
lation of LJ potential (truncated and shifted) in NVT ensemble .
2
Figure 1: Lennard-Jones potential profile. Here U=0 at rij = 1 corresponds
to a distane equal to the diameter of the particle. The truncation length is
defined by rc . To keep the U continuous the potential is shifted by U (rc ).
Here ϵ′ = ϵ + U (rc )
.
3
Next we will briefly describe a few average equilibrium quantities that
can measured in a MD simulation.
4
MSD: This measures the average square distance of a particle in a
given time interval and is defined as
*N +
D
2
E 1 X 2
r (t) ≡ |⃗ri (t) − ⃗ri (0)| (2)
N i=1
⟨r2 (t)⟩
D = lim (3)
t→∞ 6t
Time correlation function and τα : A time correlation function de-
scribes the variation of microscopic variables (eg., density, spin etc.,)
with time. They quantify how microscopic variables co-vary with one
another, on an average, across time. As a measure of this quantity
we define an self Overlap function as q(t) = N ri (t0 ) − ⃗ri (t + t0 )).
P
i=1 δ(⃗
Numerically we can compute this as
*N +
X
q(t) ≈ (1/N ) w(|⃗r(t0 ) − ⃗r(t0 + t)|) (4)
i=1
5
iii. Structural properties: We measure the structural property from a
space correlation function called radial distribution function g(r). This
quantity g(r) is a 2-point correlation function which is defined as
* +
V XX
g(r) = 2 δ(⃗r − ⃗rij ) (5)
N i j̸=i
Note that the programs for calculating MSD, q(t) and g(r) is already provided
to you. You are expected to (a.) recognize the ballistic and diffusive regime in
the MSD and compute the Diffusivity, (b.) Compute the relaxation time from
the q(t) and (c.) Comment on the g(r) profile and compute the coordination
number.
6
our simulations we take σ = 1, ϵ = 1 and m = 1, since we are not intending
to reproduce any experimental data for current purposes.
2 Simulation Procedure
2.1 Equilibrium and Data production runs
Part 1 : In the first part you will be performing MD simulations for the
following state points (density and temperature). The set of densities are
ρ = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7 and 0.8 and at each of this density perform
the simulation for the temperatures are T = 1.5, 1.3, 1.1, 0.9 and 0.7. To
perform these simulations you have to use the following command.
In the place of < density value > and < temperature value > use density
and temperature values respectively, that are provided above. Rest of the
parameters should be kept as it is and only be changed when mentioned
explicitly. In total you will be performing 40 simulations. After performing
these simulations you will find the following output files. Say the simulation
was performed at ρ = 0.1 and T = 1.5, then
iii. The data also contains datarun.dump and equilrun.dump files, which
are also called a MD trajectory files. These files contain particle co-
ordinates and velocities as a function of MD time step (during the
equilibration and data production run). These files can be further
7
processed to visualise the microscopic evolution, compute various mi-
croscopic quantities including MSD, q(t) and g(r). Note that to create
the MD trajectory you have to change the flag dumpopt 0 to dumpopt 1
in the above command. Create the trajectory files for density ρ = 0.3
(and varying temperatures) only. These files will be used in the Part
2 of the lab work.
From the equilrun.dat files you can get a rough estimate of equilibration time
(the time taken for the system to reach a saturated value and fluctuations
around it). From the datarun.dat files you can obtain the average equilibrium
pressure and hence equation of state (measure pressure vs applied density).
This will enable you to recognize the phase behaviour of the model system,
including continuous transition, liquid-gas phase transition as well as critical
point.
Part 2: In the second part you will perform microscopic analysis from
the MD trajectories. For ρ = 0.3 and varying temperature, you will (a.)
Visualise the configuration (b.) Compute the MSD (c.) Compute the q(t)
and (d.) Compute the g(r). To the carryout these four tasks you utilize four
different tools which are
ii. MSD: The mean square displacement is computed utilizing the follow-
ing command. The MSD calculation is done for all the temperatures
at the fixed density of ρ = 0.3. Say if T = 1.5
This command will create .MSD files containing the MD time step and
mean square displacement information. To plot the MSD data you
will be using a tool called Xmgrace. A short introduction Xmgrace
will be given during the lab session. You will recognize the ballistic
and diffusive regimes and also obtain the diffusion coefficient using the
Eqn. 3.
8
ii Time correlation function q(t): You will compute the q(t) utiliz-
ing the following command. If ρ = 0.3 and T = 1.5
This command will create .Corr files containing the MD time step and
q(t). Plot using Xmgrace and fit the data with a0 ∗ exp(−x/a1). Ex-
tract a1, which will be the relaxation time. Another way to obtain the
relaxation time is to compute the time taken by the system to go from
q(t)=1 to q(t)=0.
iii Radial distribution function g(r): You will compute the g(r)
utilizing the following command. If ρ = 0.3 and T = 1.5
9
3 Aim and Objectives
Answer the following questions. Make sure all the plots have labels for axes
as well as labels are with appropriate units.
Part I
Q2 Plot total energy vs. MD time step during the equilibration for ρ = 0.3
and varying temperature. Obtain the rough estimate of the relaxation
time and plot τα vs temperature T for ρ = 0.3. Plot the pressure vs.
MD time step during data production run for ρ = 0.3 and varying
temperature. [1 Mark]
Q3 Obtain average pressure from all the 40 simulations. Plot average mea-
sured P vs applied ρ for all the five isotherms T = 1.5, 1.3, 1.1, 0.9 and
0.7 in a single plot. Which of the Isotherms show monotonic behaviour
and which others show a non-monotonic behaviour. Comment on the
behaviour of the isotherms. [2 Marks]
Part II
Q4 Plot MSD vs. MD time step for fixed ρ = 0.3 and varying temperatures
in a single plot. Plot the data in log-log axis and recognize the ballistic
and diffusive regimes. Why do you have to use a log-log scale. Obtain
the diffusion coefficient D, in lin-lin axis, from the diffusive regime of
the MSD using the Eqn. 3. Plot measure D vs. applied T. [5 Marks]
Q5 Plot q(t) vs. MD time step for fixed ρ = 0.3 and varying temperatures
in a single plot (in a lin-log axis). Obtain the relaxation time τα . Plot
10
measured τα vs. applied T. Compare the estimates obtained from Q2.
[5 Marks]
9. kill [options] pid : Stop a process. If the process refuses to stop, use
kill -9 pid.
10. less [options] [filename] : View the contents of a file one page at a time.
11
16. tail [options] [filename] : Display the last n lines of a file (the default
is 10).
17. tar [options] filename : Store and extract files from a tarfile (.tar) or
tarball (.tar.gz or .tgz).
18. top : Displays the resources being used on your system. Press q to
exit.
References
[1] Frenkel, Daan, and Berend Smit. Understanding molecular simulation:
from algorithms to applications. Vol. 1. Elsevier, 2001.
[3] Thompson, Aidan P., H. Metin Aktulga, Richard Berger, Dan S. Bolin-
tineanu, W. Michael Brown, Paul S. Crozier, Pieter J. in’t Veld et al.
”LAMMPS-a flexible simulation tool for particle-based materials mod-
eling at the atomic, meso, and continuum scales.” Computer Physics
Communications (2021): 108171.
12