• No results found

Theory and Computational Methodology

3.3 Classical Molecular Modelling

3.3.3 Molecular Dynamics

Molecular dynamics (MD) simulations are similar to real experiments.

First a sample is selected. In this case an interatomic potential is defined and a system of N atoms created with some reasonable initial configuration.

Next the experiment is conducted and properties of interest are measured over a sufficient period to reduce background noise. In MD the classical equations of motion are time evolved until statistical properties are con-stant. This is a period of equilibration. Once the system is equilibrated, a production run is performed over which the properties of interest are mea-sured and averaged [134]. Molecular dynamics in this research has been performed using a modified version of the DL POLY package [132]. This section aims to introduce the underlying theory of the code. Further details regarding precise implementation are available in ref [132].

It is often convenient to express the interatomic potential within the Lagrangian framework of classical mechanics using generalised coordinates q and momenta ˙q:

where the first term is the kinetic energy and the second is the interatomic potential, Gα,β is the mass metric tensor8. Then according to the principle of least action, the correct classical trajectory is given by the path that ex-tremises the action9. This path is also that which solves the Euler-Lagrange equation:

The Euler-Lagrange equation then gives the equations of motion. For the case of an interatomic potential acting on N atoms with kinetic energy

1

2mi˙r2, the equations of motion are shown to be Newton’s laws of motion.

In Cartesian coordinates the equation of motion for the ith particle will be:

d

dtpi = Fi = XN

j6=i

fij =− XN

j6=i

1 rij

∂rijU (rij)

!

rij (3.29)

where p and Fiare the momentum and force acting on atom i, and fij is the force contribution due to the interaction with each atom j. Given the force on each particle is given by the negative gradient of the interatomic poten-tial, the system can be time evolved from the initial configuration using an integration method. A simplified flow diagram of the MD production phase is shown in Figure 3.9.

Figure 3.9: Simplified molecular dynamics process evolving the trajectory {r, p} from time t0 to T .

Classical Molecular Modelling 67

Integrator

The equations of motion (eqn. 3.29) can be solved numerically to evolve the trajectory of the ensemble of particles by use of an integrator.

These are often derived by manipulating Taylor expansions of known initial quantities (eg ri(t0)) to get stable and time reversible expressions for the same quantities at a small instant of time later (ri(t0+ ∆t)). An example is the Velocity Verlet algorithm which is performed in two stages. In the first stage, knowing the positions, velocities and forces at time t, the velocity can be integrated by half a timestep. This new velocity can then move the positions by a full timestep ∆t:

v

Since the positions are now at new coordinates they will have a differ-ent potdiffer-ential energy and therefore have new forces acting upon them. As such the forces need to be re-evaluated using eqn 3.29, which are used to advance the velocities by another half timestep to match the positions.

f (t + ∆t)⇐= f(t) (3.32)

An advantage of this integrator over others is that it only requires the calculation of the force once per timestep which is computationally expensive formally scaling as O(N2). Since a cut-off radius is being used for the short-range potentials and real space Ewald summation, a link cell approach can be used to reduce the force calculation to O(N) [132, 134].

Provided a small timestep is used, then integration using the Velocity Verlet algorithm transverses a trajectory in a microcononical (NVE)

en-semble of microstates [141]. Often this enen-semble is inconvenient and other thermodynamical ensembles are more representative of the relevant exper-imental conditions. The equations of motion can be modified to generate trajectories within a different ensemble such as the canonical (NVT) or isothermal-isobaric (NPT) by use of a thermostat algorithm.

Isothermal Ensembles

Numerous thermostat algorithms exist in order to control the sys-tem sys-temperature. As a simple method, the velocity can be rescaled to en-sure that the velocity distribution of the system corresponds to a Maxwell-Boltzmann distribution with the average kinetic energy equalling the de-sired temperature 10 [141]. However, this approach does not allow for fluc-tuations that can occur in the canonical (NVT) ensemble [134].

The method that is used throughout this thesis is the Nos´e-Hoover approach [142–144]. This method couples the real system to a heat bath by extending the Lagrangian with additional coordinates s and conjugate momenta ˙s associated with the reservoir:

L(r, ˙r, s, ˙s) = where Q is an effective mass associated with s to control the heat transfer.

L is chosen to be the number of degrees of freedom of the real system which ensures the algorithm produces a canonical ensemble of microstates [141].

From this Lagrangian new equations of motion can be derived and im-plemented with an appropriate integrator to allow isothermal calculations.

Hoover [145] later showed that these equations of motion are unique and no other equations of the same form can create a canonical distribution [134].

Through the Melchionna modification [146], a barostat can be added

10equipartition energy: hKi = 12kBNfT , where Nf is the number of internal degrees of freedom.

Classical Molecular Modelling 69

to the extended system in a similar manner in order to constrain the pres-sure through isometric regulation of the volume, to sample an isothermal-isobaric (NPT) ensemble [132]. This can be extended to permit anisotropic variations in the volume to simultaneously manipulate the cell size and shape at constant stress (N σT ) ensemble, see ref. [132].

Ergodicity and Ensemble Observables

In an experiment, a series of measurements are performed over a range of time with the properties averaged. Molecular dynamics operates on a sim-ilar paradigm whereby the system is numerically evolved and the properties of interest (A) are averaged. The trajectory of the MD simulation explores the microcanonical phase space of the ensemble (the set of positions and momenta attainable by all N atoms at a fixed energy). Under the ergodic hypothesis, it is taken that the time average ¯A is equal to the ensemble average hAiens [147]. That is, the average properties of a large number of short simulations sampling the phase space will be equivalent to a single long simulation. This principle is applied to other ensembles such that the observable property can be determined by [134]:

A = lim¯

The rolling of dice gives a simple example of ergodicity. The time average of a single die thrown 106 times will be equal to the ensemble average, in this case the average of 106 dice thrown once [147]. However, not all processes are ergodic. If the dice are magnetic such that “2” and

“5” are attracted but pairs of “2” or “5” are repelled, then the time and ensemble averages will differ. A relevant example are relaxor ferroelectrics such as PMNPT. Below a freezing transition temperature Tf, they become non-ergodic due to the freezing in and interaction of polar nanoregions which exhibit glass-like behaviour [147]. For the materials and conditions

considered in this thesis, it is expected the ergodic principle holds.

Periodic Boundary Conditions for a MD cell

Large scale atomic simulations can now involve systems on the order of 109 atoms [148]. However this is still many orders of magnitude smaller than a macroscopic system. If molecular dynamics were to be performed with the atoms in a rigid container then surface effects would dominate due to the large proportion of atoms in contact with the walls of the simulation cell. For example, a simple cubic crystal containing N3 atoms will have N3 − (N − 2)3 atoms at the surface11 which for a 1000 atom simulation would be 48.8% in direct contact with the walls.

To effectively simulate bulk properties the simulation cell can be repli-cated infinitely in all directions using periodic boundary conditions (PBC).

This enables atoms in the principle simulation box to interact with images of atoms to reinforce the correct local environment. Any particle that leaves the principle cell will be replaced by its image entering from the opposite side. To prevent self interaction between an atom and its image the cut-off radius rcut has an upper bounds of half the smallest cell dimension.

Figure 3.10: 2D representation of peri-odic boundary conditions applied to a cu-bic principle cell (grey). The velocity of each constituent atom is depicted by the vector. Atoms leaving the principle cell are replaced by their image from the op-posite cell. Short range interactions oc-cur within the sphere defined by rcut.

11N6= 1

Classical Molecular Modelling 71