<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lnw13</id>
	<title>ChemWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://chemwiki.ch.ic.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lnw13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Lnw13"/>
	<updated>2026-05-17T00:12:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543687</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543687"/>
		<updated>2016-02-26T11:42:43Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script for the calculation of the heat capacity is shown below. After the all the data has been collected for each value of the time step, the heat capacity is worked out using the averages shown above. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heatcapacity equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp)&lt;br /&gt;
variable heatcpvol equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.05&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. The solid &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shown below are the conditions used to define the three phases. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543684</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543684"/>
		<updated>2016-02-26T11:42:06Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable heatcapacity equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp)&lt;br /&gt;
variable heatcpvol equal atoms*atoms*(v_aveenergy2-v_aveenergy*v_aveenergy)/(v_avetemp*v_avetemp*vol)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script for the calculation of the heat capacity can be shown above. After the all the data has been collected for each value of the time step the heat capacity is worked out using the averages shown above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.05&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. The solid &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shown below are the conditions used to define the three phases. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543681</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543681"/>
		<updated>2016-02-26T11:39:18Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.05&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. The solid &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shown below are the conditions used to define the three phases. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543680</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543680"/>
		<updated>2016-02-26T11:37:50Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.2&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.05&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. The solid &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543677</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543677"/>
		<updated>2016-02-26T11:35:19Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. The solid &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543674</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543674"/>
		<updated>2016-02-26T11:32:48Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). These values agree with a face centered cubic structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543671</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543671"/>
		<updated>2016-02-26T11:32:03Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{lat} = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{lat} = r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. From theory, for a fcc lattice, the lattice spacing can be found by &amp;lt;math&amp;gt; r_{lat}=\sqrt[3] \frac{lattice\ points}{number\ density} = \sqrt[3]\frac{4}{1.2} = 1.49&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543660</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543660"/>
		<updated>2016-02-26T11:23:49Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Running the simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different time steps is plotted in figure (5). The time step 0.01 is too large a time step, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is a compromise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543658</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543658"/>
		<updated>2016-02-26T11:22:15Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Reduced Units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543657</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543657"/>
		<updated>2016-02-26T11:22:06Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Truncation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
===Truncation===&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored.&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543656</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543656"/>
		<updated>2016-02-26T11:21:54Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543655</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543655"/>
		<updated>2016-02-26T11:21:26Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* LAMMPS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543652</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543652"/>
		<updated>2016-02-26T11:18:30Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Reduced Units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity. For the rest of this report, only reduced units are used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543581</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543581"/>
		<updated>2016-02-26T09:54:55Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are all of the same magnitude for those calculated using the MSD. Once again the diffusion coefficient of the solid is close to 0 as the system should not undergo Brownian motion so therefore would not be expected have a significant diffusion coefficient. The diffusion coefficient for both methods of determination are very similar, and appears as though 8,000 atoms with 5000 time steps is a large enough simulation to predict the diffusion coefficient to a reasonable degree of accuracy. Although the diffusion coefficient appears to be in agreement with the values from the MSD it can be seen from the VACF that the velocities do not fully decorrelate during the length of the simulations, therefore this value of diffusion coefficient is not reliable.&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543557</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543557"/>
		<updated>2016-02-26T09:43:01Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases although as the gas never appeared to reach an equilibrium value in the VACF it may not be a reliable method of determination. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps can accurately detemine the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543547</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543547"/>
		<updated>2016-02-26T09:40:46Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simple simulations of Lennard-Jones fluids were run under a variety of different conditions. An optimum time step was determined by plotting energy timestep graphs for different values of timestep. 0.0025 was found to be optimum, as it gave a accurate values, whilst also allowing the simulation to run for long enough that the system could equilibrate correctly. Plots of the simulated density against temperature where compared to the density given by the ideal gas law, and the differences between them were due to repulsive forces felt in the Lennard Jones potential at small values of the internuclear range.&lt;br /&gt;
&lt;br /&gt;
A script was then written to return values for the heat capacity over a range of densities and temperatures. It was seen that the heat capacity does not increase with temperature, which is what would be classically predicted. Instead two regimes inside the simulations cause a lowering of the heat capacity across the transition. &lt;br /&gt;
&lt;br /&gt;
The structure of a Lennard-Jones fluid was observed using the Radial Distriubtion function. The lattice spacing was found to be between 1.45 and 1.48, in reduced units. The number of nearest neighbors were determined using the running integral of the solid RDF. &lt;br /&gt;
&lt;br /&gt;
Simulations of more atoms were found to be more stable, when considering the mean squared displacement and the velocity autocorrelation function and the diffusion coefficient was determined using the two different graphs. The values of the diffusion coefficient returned were relatively similar across the two methods, especially for the liquid and vapour phases. The diffusion coefficients determined from the VACF were all slightly higher than those determined by the MSD. In literature &amp;lt;ref name =&amp;quot;diffusion coefficient&amp;quot;&amp;gt; Schoen M, Hoheisel C, The mutual diffusion coefficient D 12 in binary liquid model mixtures. Molecular dynamics calculations based on Lennard-Jones (12-6) potentials &amp;lt;i&amp;gt;Mol. Phys&amp;lt;/i&amp;gt; [Online] 1984 52(1) Available from: DOI:10.1080/00268978400101041 Accessed 26/02/2016 &amp;lt;/ref&amp;gt; it has been reported than simulations with 100,000 time steps accurately&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543505</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543505"/>
		<updated>2016-02-26T09:15:08Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543501</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543501"/>
		<updated>2016-02-26T09:11:25Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For te solid, the lattice spacing can be determined from the positions of the peaks. As seen in fig. (10) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.45 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the lattice spacing must lie somewhere between these two values, depending on the uniformity and degree of vibration in the lattice. &lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543498</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543498"/>
		<updated>2016-02-26T09:07:34Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states.]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543497</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543497"/>
		<updated>2016-02-26T09:07:07Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (8)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543496</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543496"/>
		<updated>2016-02-26T09:06:20Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Running the simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (5). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543494</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543494"/>
		<updated>2016-02-26T09:05:38Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; Hansen J-P., Verlet Loup, Phase Transitions of the Lennard-Jones System &amp;lt;i&amp;gt;Physical Review&amp;lt;/i&amp;gt; 1969 &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;(1) 155 Acessible at: http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states &amp;lt;ref name=&amp;quot;LJ curve&amp;quot;/&amp;gt;]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543485</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543485"/>
		<updated>2016-02-26T08:53:03Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (13), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain several minima. The liquid has one minimum, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0, with the veocity no longer correlated with respect to time. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543480</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543480"/>
		<updated>2016-02-26T08:44:52Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. (7), the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This is due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. This causes less vibration with increased temperature but more diffusion, leading to a lower internal energy. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543126</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=543126"/>
		<updated>2016-02-25T20:32:22Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Figure (4). Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left|thumb|Figure (5). Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (6). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted, see fig. (6), and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (7). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Figure (8). Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (9). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame|Figure (10). Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb |Figure (11). Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (11). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (12). Plots of Mean Squared Displacement for three phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (13). Plot of Velocity Autocorrelation function for three phases, with Simple Harmonic VACF plotted alongside.&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Figure (14). Plots of Running Integral of VACF for three different phases.&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542772</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542772"/>
		<updated>2016-02-25T16:57:01Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb | Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (x). &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542690</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542690"/>
		<updated>2016-02-25T16:42:47Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File: lnwRdf_running_integral.PNG| thumb | Running integral of Radial Distribution Function for face centered cubic solid]]&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (x).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwRdf_running_integral.PNG&amp;diff=542684</id>
		<title>File:LnwRdf running integral.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwRdf_running_integral.PNG&amp;diff=542684"/>
		<updated>2016-02-25T16:41:59Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542633</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542633"/>
		<updated>2016-02-25T16:36:39Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. This indicates some short range order in the liquid, although no long range, with 3 or 4 shells of atoms surrounding the considered atom.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The RDF of the solid reflects the structure of the lattice. Due to the long range order of the solid, there is structure to the RDF far from the atom, although the peaks broaden due to fluctuations in the atom positions.&lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]], the first peak corresponds to an shell of nearest neighbors in the middle of the adjacent face, where &amp;lt;math&amp;gt; r_{1} = r_l \times cos(\frac{\pi}{4})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find the lattice spacing, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_l = \frac{r_1}{cos(\frac{\pi}{4})} = \frac {1.03}{cos(\frac{\pi}{4})} = 1.44&lt;br /&gt;
&lt;br /&gt;
Alternatively the distance to the 2nd nearest neighbor should also give the lattice spacing. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_2 = 1.48&lt;br /&gt;
&lt;br /&gt;
The number of nearest neighbors is determined from the running integral, fig (x).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 24&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwNearestneighbors.png&amp;diff=542499</id>
		<title>File:LnwNearestneighbors.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwNearestneighbors.png&amp;diff=542499"/>
		<updated>2016-02-25T16:17:25Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: Lnw13 uploaded a new version of File:LnwNearestneighbors.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542141</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=542141"/>
		<updated>2016-02-25T15:32:13Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(\tau)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. The biggest source of error in the diffusion coefficients calculated from the VACF is probably due to the false assumption that the systems have reached equilibrium. The system with 8000 atoms must take longer to reach a stable state as the lower density  means less collisions occur in the same period of time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lnwInt8000solid.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000sol.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lnwInt8000liq.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000liq.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwInt8000vap.PNG|400px]]&lt;br /&gt;
| [[File:lnwInt1000000vap.PNG|400px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000vap.PNG&amp;diff=542049</id>
		<title>File:LnwInt1000000vap.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000vap.PNG&amp;diff=542049"/>
		<updated>2016-02-25T15:17:08Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000vap.PNG&amp;diff=542044</id>
		<title>File:LnwInt8000vap.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000vap.PNG&amp;diff=542044"/>
		<updated>2016-02-25T15:16:37Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000liq.PNG&amp;diff=542037</id>
		<title>File:LnwInt1000000liq.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000liq.PNG&amp;diff=542037"/>
		<updated>2016-02-25T15:16:04Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000liq.PNG&amp;diff=542035</id>
		<title>File:LnwInt8000liq.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000liq.PNG&amp;diff=542035"/>
		<updated>2016-02-25T15:15:33Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000sol.PNG&amp;diff=542033</id>
		<title>File:LnwInt1000000sol.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt1000000sol.PNG&amp;diff=542033"/>
		<updated>2016-02-25T15:14:56Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000solid.PNG&amp;diff=542030</id>
		<title>File:LnwInt8000solid.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LnwInt8000solid.PNG&amp;diff=542030"/>
		<updated>2016-02-25T15:14:36Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541895</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541895"/>
		<updated>2016-02-25T14:56:27Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lWATSONLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The minima in the curve corresponds to a collision in the system leading to the a change in velocity. The VACF of the vapour contains no minima as the system is so diffuse that no collisions are experienced within the simulation. Both the solid and liquid contain minima. The liquid has one minima, and and then slowly returns to a VACF value of 0. The solid experiences several minima, due to the order and structure of the solid lattice and it too appears to oscillate around the x-axis and eventually stabilises at 0. The simple harmonic oscillator however, never reaches a constant value. This is because it never experiences collisions, as it only oscillates around its own equilibrium position and thus never decorrelates from its velocity at t=0.  &lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LWATSONLiq_sol_vacf.PNG&amp;diff=541835</id>
		<title>File:LWATSONLiq sol vacf.PNG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LWATSONLiq_sol_vacf.PNG&amp;diff=541835"/>
		<updated>2016-02-25T14:47:42Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541680</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541680"/>
		<updated>2016-02-25T14:27:58Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Plotting Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy between the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541658</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541658"/>
		<updated>2016-02-25T14:24:09Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. The resultant plots of mean squared displacement are as expected. The solid simulations reach a constant value of displacement after equilibration, as solids do not experience Brownian motion. Both the liquid and the vapour mean square displacements increase with time, as they undergo movement in their fluid states. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541631</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541631"/>
		<updated>2016-02-25T14:20:42Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The plot for the liquid system appears to be a straight line,and only has a very small non-linear region so the gradient can be determined over the whole range of time step, whereas for the solid and vapour the diffusion coefficient can only be determined from the region of the graph with a constant gradient as they have much larger non-linear regions. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system. The simulations with 1,000,000 molecules appear to have reached a more stable value of equilibrium, due to the increased number of molecules in the system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541581</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541581"/>
		<updated>2016-02-25T14:10:30Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541561</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541561"/>
		<updated>2016-02-25T14:05:51Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Dynamical Properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;| Diffusion Coefficient&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| 8,000 molecules&lt;br /&gt;
| 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541530</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541530"/>
		<updated>2016-02-25T13:58:36Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;Bolmatov D., Brazhkin V.V., Trachenko K., Thermodynamic behavious of supercritical matter, &amp;lt;i&amp;gt;Nature Communications&amp;lt;/i&amp;gt; [Online] 2013 &amp;lt;b&amp;gt;4&amp;lt;/b&amp;gt; (2331) Available from: doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541496</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541496"/>
		<updated>2016-02-25T13:51:10Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541490</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541490"/>
		<updated>2016-02-25T13:50:41Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Heat Capacities using Statistical Physics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;doi:10.1038/ncomms3331&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541485</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541485"/>
		<updated>2016-02-25T13:49:41Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt; http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151 &amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541483</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541483"/>
		<updated>2016-02-25T13:48:36Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Simulation of a Simple Liquid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;References /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541479</id>
		<title>Rep:Mod:lnwliqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:lnwliqsim&amp;diff=541479"/>
		<updated>2016-02-25T13:47:17Z</updated>

		<summary type="html">&lt;p&gt;Lnw13: /* Structural Properties and the Radial Distribution Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Simulation of a Simple Liquid=&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
The Schr&amp;amp;ouml;dinger equation can be use to describe the behaviour of chemical systems. However it can only be solved accurately for a single hydrogen atom. To approximate a larger system, a classical particle theory can be applied. For a system of N atoms, each atom will interact with every other atom in the system. The force felt by each can be used to detemine the velocity with which it is moving. &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F_i = m_i \mathbf a_i = m_i \frac {d \mathbf v_i}{dt} = m_i \frac {d^2 \mathbf x_i} {dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For N atoms, N equations are needed to describe the system. The Verlet alogrithm is used to help solve these systems of equations, by comparing the Taylor expansion of the  position of a particle &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; both forward and backwards it time to get.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;  \mathbf x_i ( t + \delta t ) \approx 2 \mathbf x_i (t) - \mathbf x_i \left (t - \delta (t) \right ) + \frac { \mathbf F_i (t) \delta t^2 } {m_i} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the velocity cannot be determined using this method, therefore another version of the Verlet algorithm known as the Velocity Verlet Algorithm is used instead. This works by taking the acceleration into account, and considering half time steps, &amp;lt;math&amp;gt;\frac {1}{2} \delta (t)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; \mathbf v_i (t + \delta t) = \mathbf v_i \left ( t+\frac {1}{2} \delta t \right ) +\frac {1} {2} \mathbf a_i ( t + \delta t)\delta t &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the time, the clasical analytical value of displacement was calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x(t) = A cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and the error was found by finding the difference between the classical value and the position value determined by the Verlet algorithm. The total energy of the system was found by summing the kinetic and potential energies of the Verlet system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{tot} = \frac {1}{2} m \mathbf v^2 + \frac {1}{2} k \mathbf x^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;  style = &amp;quot;background: white;&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; |Figure (1). Graphs showing the Velocity and Energy of the Verlet Velocity Algorithm.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwDisplacement.PNG| 600px]]&lt;br /&gt;
! [[File: lnwEnergy.PNG|600px ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As seen in Fig. (1) and (2), the error increases with every oscillation, and what can appear a small error is carried forward with every iteration and the error is compounded. This is because the two systems are slightly out of phase with each other and so as the silution progresses this difference has a larger and larger effect on the relationship between them. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;text-align: left;&amp;quot; | Figure (2). Graphs showing Error of the Verlet Velocity compared to the Classical Solution.&lt;br /&gt;
|-&lt;br /&gt;
! [[File: lnwError.PNG|400px]]&lt;br /&gt;
![[File:Lw-energymaxvtime.png|400px]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File: lnwEnergydiffvtime.PNG| thumb | Figure (3). Percentage Energy Difference over the whole system against value of Time Step]]&lt;br /&gt;
The energy difference of the system over time was plotted against changing values of the time step, see fig. (3). A value for the time step less that 0.20 ensured that the energy difference between the maximum and minimum for a system was not more than 1%. The energy of an isolated system should be monitored during simulation to ensure that energy is conserved.&lt;br /&gt;
&lt;br /&gt;
===Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The force acting on an object is determined by the potential it experiences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i = - \frac {dU(\mathbf r^N)}{d \mathbf r_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For many simple systems the same potential can be applied. The Lennard Jones curve contains a large repulsive potential at small separations and a harmonic potential close to equilibrium, with the form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U(\mathbf{r}^N) = \sum_i^N \sum_{i \neq j}^{N} 4\epsilon \left ( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard Jones interaction, &amp;lt;math&amp;gt;\phi(r) = 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right )&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt; occurs when &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;. The force experienced at this separation is found by differentiating the potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) = \phi&#039;(r_0) = \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \mathbf F_i = \frac {-24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium value of for position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is found by considering &amp;lt;math&amp;gt;\mathbf F_i = 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf F_i(r_0) =  \frac {-24\epsilon}{r_0} \left (2 \frac {\sigma^{12} }{r_0 ^{12} } - \frac {\sigma^6}{r_0 ^6} \right ) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac {2\sigma^{12}}{r^{12}} = \frac {\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; r_{eq} = 2^{\frac {1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt;\phi (r_{eq})&amp;lt;/math&amp;gt;, gives an idea of the strength of interaction between the two particles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma ^{12}} {(2^{\frac{1}{6}}\sigma)^{12}} -\frac{\sigma ^{6}} {(2^{\frac{1}{6}}\sigma)^{6}}\right )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \phi (r_{eq}) =  4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Integral of the potential curve gives the total energy of all particles in the system under the curve to the point. By integrating from a cut-off to infinity, the interaction energy of all particles with an inter-atomic separation larger than the cut off point is calculated. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r = \int\limits_{x}^{\infty} 4\epsilon \left ( \frac{\sigma^{12}} {r_{ij}^{12}} - \frac {\sigma^6}{r_{ij}^6} \right ) d \mathbf r &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\limits_{x}^{\infty} \phi(r) d \mathbf r= \left [ \frac {-4\sigma^{12}} {11r^{11}} + \frac {4\sigma^6} {5r^5} \right ]_x^\infty &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
! Evaluation of Integral&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.0248&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;2.5\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00873&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;amp;minus;0.00329&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
Realistic volumes of liquid contain many moles of particles which cannot be reasonably simulated even with vast amounts of computational power. In 1 mL of water,  there are &amp;lt;math&amp;gt; 3.342 \times 10^{22} &amp;lt;/math&amp;gt; molecules. For a reasonable simulation, around 1000-10,000 molecules are simulated. Again considering water, the volume of 10,000 molecules is &amp;lt;math&amp;gt; 2.99 \times 10^{-20} &amp;lt;/math&amp;gt; mL, far smaller than any real world system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To simulate a bulk liquid, the unit cell that is considered is imagined to be replicated in every direction. This means that as one particle leaves one edge of the main box, it re-enters through the opposite edge. For example an atom that starts at &amp;lt;math&amp;gt; \left ( 0.5, 0.5, 0.5 \right ) &amp;lt;/math&amp;gt; and moves &amp;lt;math&amp;gt; \left ( 0.7, 0.6, 0.2 \right ) &amp;lt;/math&amp;gt; during the course of the simulation, ends up at &amp;lt;math&amp;gt; \left ( 0.2, 0.1, 0.7 \right ) &amp;lt;/math&amp;gt; after application of the boundary conditions.&lt;br /&gt;
&lt;br /&gt;
====Truncation====&lt;br /&gt;
&lt;br /&gt;
Due to the replication of every particle in the infinite cells in every direction, the number of interactions of the particles must be controlled. This is done by setting a distance, &amp;lt;math&amp;gt; \mathbf x &amp;lt;/math&amp;gt;, at which the interaction energy (measured by the area under the Lennard-Jones potential) is small enough to be considered neglible, and thus can be ignored. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
When working with the Lennard Jones Potential, reduced units are often used. This is done to make values more managable, no longer having to deal with power terms, instead numbers near unity.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Formula&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| distance&lt;br /&gt;
|&amp;lt;math&amp;gt; r* = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| energy&lt;br /&gt;
| &amp;lt;math&amp;gt; E* = \frac{E} {epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|temperature&lt;br /&gt;
|&amp;lt;math&amp;gt;T*= \frac {k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For argon, &amp;lt;math&amp;gt; \sigma = 0.34 nm &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \frac {\epsilon}{k_B} = 120 K &amp;lt;/math&amp;gt;, the Lennard-Jones cut-off is &amp;lt;math&amp;gt; r* = 3.2 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In real units this cut off is equal to &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r* \times \sigma = 3.2 \times 0.34 nm = 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in real units is equal to&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = E*_{well depth} \times \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_{well depth} = -1 \times (120 \times k_B) = -1.657 \times 10^{-21} J = 1.005 kJ mol^-1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and the temperature when &amp;lt;math&amp;gt; T* = 1.5 &amp;lt;/math&amp;gt;, is &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {T* \epsilon}{k_B} = T = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LAMMPS===&lt;br /&gt;
&lt;br /&gt;
The liquid simulations were run using LAMMPS, Large-scale Atomic/Molecular Massively Parallel Simulator. LAMMPS is a classical molecular dynamics code used to model atoms, particle systems and polymers under different conditions. It can run several different simulations in parallel from one script. LAMMPS can be programmed to calculate and record data points of many different system variables.&lt;br /&gt;
&lt;br /&gt;
For our initial simulations a simple cubic lattice is constructed using &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt;. Then the &lt;br /&gt;
lattice parameters set and the simulation cell defined in terms of the lattice unit. This cell is then filled with atoms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;amp;#35; &amp;amp;#35; &amp;amp;#35; DEFINE SIMULATION BOX GEOMETRY &amp;amp;#35; &amp;amp;#35; &amp;amp;#35;&lt;br /&gt;
lattice sc 0.8&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
The same script was run at 5 different time steps to determine the effect of the time steps on the outcome of the simulation. A crystal lattice is generated, then melted to simulate a liquid-like structure. Atoms are not generated with random starting coordinates as they could end up being too close together and giving the energy value of the system an abnormally high value due to the strength of their interaction. &lt;br /&gt;
&lt;br /&gt;
The lattice is &#039;built&#039; in the script with a simple cubic structure and a number density of 0.8. The output file gives us the lattice spacing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; Lattice spacing in x,y,z = 1.07722 1.07722 1.07722 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two values both correspond to the same lattice.&lt;br /&gt;
&lt;br /&gt;
The volume of the cell is &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; 1.07722^3 = 1.25 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
and the number density is given by &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac {1}{vol_{  cell}} = \frac {1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
A block of 10 x 10 x 10 unit cells is created and 1000 atoms created to fill the whole system, from the command &amp;lt;pre&amp;gt; create_atoms 1 box &amp;lt;/pre&amp;gt;  As this lattice has been defined as a simple cubic lattice it containes only 1 lattice point per cell. For a face centered cubic lattice, there are 4 lattice points per unit cell, if this same command was used to create atoms to fill a fcc lattice, would generate not 1000 atoms but 4000. &lt;br /&gt;
&lt;br /&gt;
====Setting the properties of atoms====&lt;br /&gt;
&lt;br /&gt;
A script used to define the properties of the atoms is given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0 &lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command &amp;lt;i&amp;gt;mass&amp;lt;/i&amp;gt; sets the mass of the atom type. This would give all atoms of type 1 a mass of 1.0. &lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;pair_style&amp;lt;/i&amp;gt; defines the pairwise interactions felt by the particles. In this case, the standard 12/6 Lennard-Jones potential is computed. It also defines the cutoff point given by &amp;lt;i&amp;gt;cut&amp;lt;/i&amp;gt; at which interaction energies are considered negligible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;Pair_coeff&amp;lt;/i&amp;gt; defines he pairwise force field coefficients felt by pairs of atoms. The * defines this for all atoms in the system. The last two arguments are parameters for &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; respectively.  &lt;br /&gt;
&lt;br /&gt;
The velocity of each atoms is then specified in the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; velocity all create 1.5 12345 dist gaussian rot yes mom yes &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
By using the command &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt;, all atoms in the simulation will be assigned a velocity. &amp;lt;i&amp;gt;Create 1.5 12345 dist gauss&amp;lt;/i&amp;gt; tells the program to generate an array of velocities with a random number generator, at a specified temperature, using a gaussian distribution. The linear and angular momentums of the velocities is set to 0 by &amp;lt;i&amp;gt;mom yes rot yes&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As both the position &amp;lt;math&amp;gt;\mathbf x_i&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt; \mathbf v_i &amp;lt;/math&amp;gt; are specified the Verlet Velocity Algorithm is used. &lt;br /&gt;
&lt;br /&gt;
====Running the simulation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;i&amp;gt;varible timestep equal 0.001&amp;lt;/i&amp;gt; logs a value of 0.001. If the word &amp;lt;i&amp;gt;&#039;timestep&#039;&amp;lt;/i&amp;gt; appears on subsequent lines in a function , ${}, then this string is replaced by the value, 0.001.  This could also be written &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, if the timestep is to be varied, the top script makes it much quicker to change, only having to edit one line. In the second script, every term containing the timestep would need to be edited individually. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right:auto; border: none;&amp;quot;&lt;br /&gt;
|+ Graphs of Energy, Pressure and Temperature against time for 0.001 system.&lt;br /&gt;
! Energy&lt;br /&gt;
! Pressure&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwIntro0.001energy.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001pressure.PNG|300px]]&lt;br /&gt;
| [[File:lwIntro0.001temp.PNG|300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:lwIntrototalenergy.PNG|500px|left| Energy vs Time for each value of time step]] The energy against time for 5 different timesteps is plotted in figure (x). The timestep 0.01 is too large a timestep, and causes an error due to the nature of the verlet algorithm which is compounded with each step. Although both 0.01 and 0.0075 both reach equilibrium, they give a slightly more positive value of the energy than 0.0025 and 0.001 both give similar energies, and also reach equilibrium. The value of the time step is comprimise between the a short step to give accurate values compared to reality and a larger step in order to cover a longer period of time for a given number of iterations of the program. As a balance between accuracy and length of simulation 0.0025 gives the most acceptable results.&lt;br /&gt;
&lt;br /&gt;
==Simulations under Specific conditions==&lt;br /&gt;
&lt;br /&gt;
The microcanonical ensemble was used in previous simulations, which keeps the number of particles, the volume of the system and the total energy of the system constant. However, this is not very useful to simulate chemical systems, which often operate under constant pressure. For this the isobaric-isothermal ensemble, NpT, can be used. The program runs by &#039;melting&#039; a crystal lattice, but defines different thermodynamic variables to keep constant in the system.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable T equal ...&lt;br /&gt;
variable p equal ...&lt;br /&gt;
variable timestep equal ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature of the system is kept contant during the simulations using the equipartion theorum. By equating the energy from the equipartition theorum with the kinetic energy&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; E_k = \frac {3}{2}Nk_BT = \frac{1}{2} \sum _i m_i v_i^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the instantaneous temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;,  of the system is calculated. The instantaneous temperature will fluctuate as the simulation proceeds, so it keep the temperature at the preset temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, the velocity is premultiplied by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is found by comparing &amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt; (1) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; (2) &amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and solving for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. By dividing (2) by (1), gamma is found to be&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt {\frac {\mathfrak{T}} {T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code above generates an average over the entire system. The three numbers &amp;lt;i&amp;gt;100 1000 100000&amp;lt;/i&amp;gt; determine the range over which the average will be taken.  After 100,000 steps (i.e. the end of the simulation), 1000 values are averaged, with the values being sampled from every 100 timesteps. For a run of 100000 timesteps with a timestep of 0.0025 the total duration of the simulation will be 250 seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations were run for 5 different temperatures at [[File:lnwDenistyvtemp.PNG| 600px | thumb| Figure (x). Graph of density against Temperature, with comparison to the Ideal Gas Law.]]&lt;br /&gt;
* 1.55 &lt;br /&gt;
* 1.75&lt;br /&gt;
* 1.95&lt;br /&gt;
* 2.15 &lt;br /&gt;
* 2.35&lt;br /&gt;
with at two different pressures, 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
The graphs of density against time temperature for the two different pressures were plotted and compared to the theoretical density from the Ideal Gas Law. The simulated density was much lower than the density predicted using the Ideal Gas Law. This is because one of the assumptions made when using the Ideal Gas Law, is that there are no interactions between molecules. In the Lennard-Jones potential there is a large repulsive force experience when the inter-nuclear separation becomes too small, but this is not present in the Ideal Gas model. This means that atoms can pack together as close as their radius allows without any energy penalties, unlike a real system where electrostatic repulsions would prevent this. At &amp;lt;math&amp;gt;T = 0&amp;lt;/math&amp;gt;, the density in the Ideal Gas model would be infinite. However, at higher values of temperature, the discrepancy of the two models decreases.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a given temperature. It can be found by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial U}{\partial T} = \frac {Var[E]}{k_B T^2} = N^2 \frac {\langle E^2 \rangle - \langle E \rangle ^2} {k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where Var[E] is the variance in the energy. The factor of &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required to correct the output to the total energy, rather than the energy per particle which is what is automatically generated by LAMMPS. &lt;br /&gt;
&lt;br /&gt;
As before, a crystal is built and then melted, and the density of the crystal is changed by varying the &amp;lt;i&amp;gt;lattice&amp;lt;/i&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; lattice sc ... &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike previously, where we worked in the NpT ensemble, to calculate the heat capacity the NVT ensemble must be used, which was done as seen below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The an example full script can be found [[Media:lnwHc0.22.0.txt|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:Lnwheatcapacitypvol.PNG|500px|thumb|right|Figure (x). Heat Capacity per Volume against Temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run, at two densities, 0.2 and 0.8 and 5 temperatures, 2.0, 2.2, 2.4, 2.6 and 2.8. &amp;lt;math&amp;gt;\frac {C_V}{V}&amp;lt;/math&amp;gt; was plotted as a function of temperature. As seen in fig. x, the heat capacity decreases with increased temperature for both systems. Heat capacity is defined as &amp;lt;math&amp;gt; C_V = \frac {\partial U}{\partial T}&amp;lt;/math&amp;gt;.  It would be expected that the heat capacity of the system increased with temperature as the rotational and vibrational energy levels become accessible at higher temperatures, and contribute to the internal energy of the system, increasing the heat capacity. However, this is not seen in the simulation. This could be due to the system crossing the Frenkel line, and moving from a relatively rigid vibrational mode into a more diffuse gas like system &amp;lt;ref name=&amp;quot;frenkel line&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;. The system with the lower density has a lower heat capacity per volume. This is expected as heat capacity is an extensive property, so a system with more atoms (for example, a higher density) would have a larger heat capacity.&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function of a liquid system is very useful. It can be used to determine many different properties of the system, including the structure and parameters of the lattice. The radial distriubtions, and running integrals, of solid, liquid and vapour phases of a Lennard-Jones fluid were simulation using VMD. The densities and temperature were determined using fig (x)&amp;lt;ref name=&amp;quot;LJ curve&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:lnwLennard-jones-phase.PNG|frame|Coexistance curve of Lennard-Jones Fluid]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Phase&lt;br /&gt;
! Density&lt;br /&gt;
! Temperature&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.5&lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.85&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.01&lt;br /&gt;
|1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RDFs for the three phases are all identical until from r = 0 to r = 0.875. This is due to the strong repulsive potential experienced at short distances. The RDF of the vapour phase has only one peak at r = 1.125. A large peak occurs around this value for all three phases. The liquid RDF has peaks several peaks that oscillate around 1 with the amplitude decaying exponentially as r increases. The RDF of the solid also appears to oscillate around 1 but with less order than the liquid or vapour phases, but the ampiltude of the RDF also decreases with distance.  [[File:LnwRDF-LJ.PNG|thumb| left|Figure (x). Radial Distribution Functions of solid, liquid and vapour states]] The solid has more nearest neighbours than both solid and vapour, and the liquid has more than the vapour. The average distance between molecules is much larger in the vapour phase than in the solid or the liquid. The peak distance in the liquid is also larger than the solid. &lt;br /&gt;
&lt;br /&gt;
For the solid, the lattice spacing can be determined from the positions of the peaks. When the simulation was run, a face centered cubic lattice was used, with a number density of 0.8. This gives a theoretical cell length of 1.70. However, when looking at the RDF this is not the case. As see from fig (x) [[File:lnwNearestneighbors.png| frame| Schematic showing nearest neighbors on face centered cubic lattice.]] Considering position x as the reference atom, its nearest neighbor is site 1. This would be expected to be the cell length, however, the peak corresponding to site 1 occurs at 1.075. The peak due to the second nearest neighbor, site 2, occurs at 1.475 and the third nearest neighbor, site 3, at 1.825. The coordination number of the first three peaks can be found using the running integral generated during generation of the RDF. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://journals.aps.org/pr/pdf/10.1103/PhysRev.184.151&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Nearest Neighbor&lt;br /&gt;
! Integral Range&lt;br /&gt;
! Coordination number&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 0 - 12&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 12-18&lt;br /&gt;
| 6&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 18 - 42&lt;br /&gt;
| 42&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement of a particle is the average deviation of a particle with reference to a standard position over time.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; MSD = \langle ( x - x_0)^2 \rangle = \frac {1}{T} \sum_{t=1}^T (x(t)-x_0)^2 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations for 8,000 atoms were run to determine the mean square displacement, and then compared to systems simulated with 1,000,000 atoms. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| [[File:lw_Solid_msd.PNG| 300px]]&lt;br /&gt;
| [[File:lw_Solid_1000000_msd.PNG| 300px]]&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| [[File:lw_Liquid_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnw_Liquid_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| [[File:lnwVapour_msd.PNG|300px]]&lt;br /&gt;
| [[File:lnwVapour_1000000_msd.PNG|300px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt; D&amp;lt;/math&amp;gt; is found by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{\partial \langle r^2(t) \rangle} {\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By taking the derivative of the MSD after the system has equilibrated, the diffusion coefficient is found to be&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; -2.82 \times 10^{-7} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; -8.43 \times 10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt;8.49 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;8.73 \times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.55 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt;3.13 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The calculated value for the solid for both simulations is so low, that it can be assumed that diffusion does not occur. The values of diffusion coefficient calculated by the 1,000,000 system are higher than those calculated from the 8,000 molecule system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be calculated using the velocity autocorrelation function,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; C(\tau) = \langle \mathbf v(t) \cdot \mathbf v(t+\tau) \rangle &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is able to show us how different an atom will be at time &amp;lt;math&amp;gt;t+ \tau &amp;lt;/math&amp;gt; and time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; . An atoms velocity at large values of time should not depend on its velocity at small values of time. The diffusion coefficient can be found by integrating &amp;lt;math&amp;gt; C(t)&amp;lt;/math&amp;gt; at time, &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using the 1D harmonic oscillator model, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = -A\omega sin(\omega t +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and substituting into &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} -A\omega sin(\omega t + \phi) \cdot -A\omega sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}(-A)^2\omega^2 sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty}sin(\omega t + \phi)\cdot sin(\omega (t + \tau) + \phi) dt} {\int_{-\infty}^{\infty}sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitutions can be used to simplify the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \alpha = \omega t + \phi &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \beta = \omega \tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; dt = \frac {1}{\omega} d\alpha &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral then becomes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha + \beta ) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta ) + sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} + \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha)sin(\beta) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the first term, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot sin(\alpha)cos( \beta )} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;cos(\beta)&amp;lt;/math&amp;gt; can be taken out of the equation as it is constant, we then get&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = cos( \beta ) \frac {\int_{-\infty}^{\infty} sin^2(\alpha)} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = cos(\beta) \times 1 = cos(\beta)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now considering the second term, we can remove the constant from the denominator,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;sin(\alpha)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;cos(\alpha)&amp;lt;/math&amp;gt; is an even function. The product of an odd and even function will always be odd. It can be shown that the integral of an odd function is always 0, as long as the limits are symmetric about the x-axis. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = sin(\beta) \frac {\int_{-\infty}^{\infty} sin(\alpha) \cdot cos(\alpha) d\alpha} {\int_{-\infty}^{\infty} sin^2(\alpha) d\alpha} = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So the solution of the normalized velocity autocorrelation function of the 1D harmonic oscillator is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; C(\tau) = \frac {\int_{-\infty}^{\infty} v(t) v(t + \tau) dt} {\int_{-\infty}^{\infty}v^2(t)dt} = cos(\beta) = cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:lwLiq_sol_vacf.PNG| 600px]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The VACFs of the liquid and solid simulations done previously are shown in fig. (x), plotted along side the VACF of a simple harmonic oscillator. The VACF of the harmonic oscillator is very different from that of the solid and liquid. The VACF for the solid decays much faster than the VACF for the liquid, due to its higher density. The minima for the solid system occurs sooner than the minima for the liquid system. WHY The velocities de-correlate due to collisions in the system, and for a system with higher density there are more collisions in a smaller time period so faster decay of the velocity correlations. The VACF of the simple harmonic oscillator is vastly different from the VACFs of the Lennard Jones potential. This is due to the lack of damping or energy loss in the harmonic system.&lt;br /&gt;
&lt;br /&gt;
By integration of the velocity autocorrelation function at time &amp;lt;math&amp;gt; t=0&amp;lt;/math&amp;gt;, the diffusion coefficient can be found. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac {1}{3} \int_0^{\infty} d\tau \langle \mathbf v (0) \cdot \mathbf v (\tau) \rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{0}^{\infty} f(x) dx = \frac{h}{2} \bigg [ y_0 + y_n +2(y_1 + y_2 + ... + y_{n-2} + y_{n-1})\bigg]&amp;lt;/math&amp;gt;&lt;br /&gt;
is used to approximate the area under the velocity autocorrelation function for each phase, and the diffusion coefficient determined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &lt;br /&gt;
! 8,000 molecules&lt;br /&gt;
! 1,000,000 molecules&lt;br /&gt;
|-&lt;br /&gt;
| solid&lt;br /&gt;
| &amp;lt;math&amp;gt; 8.30 \times 10^{-4} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 4.55 \times 10^{-5} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| liquid&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.79 \times 10^{-2} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 9.01\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| vapour&lt;br /&gt;
| &amp;lt;math&amp;gt; 2.67 &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 3.27 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integral of the VACF plot for both the 8,000 and 1,000,000 molecule systems were plotted. &lt;br /&gt;
&lt;br /&gt;
INSERT IMAGES HERE!&lt;/div&gt;</summary>
		<author><name>Lnw13</name></author>
	</entry>
</feed>